#! /bin/sh # Generated from /Users/akim/src/gnu/bison/tests/local.at by GNU Autoconf 2.69. # # Copyright (C) 2009-2012 Free Software Foundation, Inc. # # This test suite is free software; the Free Software Foundation gives # unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} # How were we run? at_cli_args="$@" # Not all shells have the 'times' builtin; the subshell is needed to make # sure we discard the 'times: not found' message from the shell. at_times_p=false (times) >/dev/null 2>&1 && at_times_p=: # CLI Arguments to pass to the debugging scripts. at_debug_args= # -e sets to true at_errexit_p=false # Shall we be verbose? ':' means no, empty means yes. at_verbose=: at_quiet= # Running several jobs in parallel, 0 means as many as test groups. at_jobs=1 at_traceon=: at_trace_echo=: at_check_filter_trace=: # Shall we keep the debug scripts? Must be `:' when the suite is # run by a debug script, so that the script doesn't remove itself. at_debug_p=false # Display help message? at_help_p=false # Display the version message? at_version_p=false # List test groups? at_list_p=false # --clean at_clean=false # Test groups to run at_groups= # Whether to rerun failed tests. at_recheck= # Whether a write failure occurred at_write_fail=0 # The directory we run the suite in. Default to . if no -C option. at_dir=`pwd` # An absolute reference to this testsuite script. case $as_myself in [\\/]* | ?:[\\/]* ) at_myself=$as_myself ;; * ) at_myself=$at_dir/$as_myself ;; esac # Whether -C is in effect. at_change_dir=false # Whether to enable colored test results. at_color=auto # List of the tested programs. at_tested='bison' # As many question marks as there are digits in the last test group number. # Used to normalize the test group numbers so that `ls' lists them in # numerical order. at_format='???' # Description of all the test groups. at_help_all="1;input.at:27;Invalid number of arguments;; 2;input.at:58;Invalid options;; 3;input.at:81;Invalid inputs;; 4;input.at:111;Invalid inputs with {};; 5;input.at:137;Yacc warnings on symbols;; 6;input.at:168;Yacc warnings;; 7;input.at:202;Yacc's %type;; 8;input.at:251;Invalid symbol declarations;; 9;input.at:305;Redefining the error token;; 10;input.at:351;Dangling aliases;; 11;input.at:377;Symbol declarations;; 12;input.at:476;Invalid \$n and @n;; 13;input.at:500;Type Clashes;; 14;input.at:722;Unused values;; 15;input.at:732;Unused values before symbol declarations;; 16;input.at:742;Symbol redeclared;; 17;input.at:780;Symbol class redefinition;; 18;input.at:820;Default %printer and %destructor redeclared;; 19;input.at:891;Per-type %printer and %destructor redeclared;; 20;input.at:934;Undefined symbols;; 21;input.at:966;Unassociated types used for a printer or destructor;; 22;input.at:995;Useless printers or destructors;; 23;input.at:1060;Unused values with default %destructor;; 24;input.at:1108;Unused values with per-type %destructor;; 25;input.at:1140;Duplicate string;; 26;input.at:1168;Token collisions;; 27;input.at:1196;Incompatible Aliases;; 28;input.at:1321;Torturing the Scanner;; 29;input.at:1478;Typed symbol aliases;; 30;input.at:1518;Require 1.0;; 31;input.at:1519;Require 3.5.4;; 32;input.at:1521;Require 100.0;; 33;input.at:1528;String aliases for character tokens;; 34;input.at:1551;Symbols;; 35;input.at:1617;Numbered tokens;; 36;input.at:1659;Unclosed constructs;; 37;input.at:1714;%start after first rule;; 38;input.at:1735;%prec takes a token;; 39;input.at:1756;%prec's token must be defined;; 40;input.at:1776;Reject unused %code qualifiers;; 41;input.at:1865;Multiple %code;; 42;input.at:1905;errors;; 43;input.at:1942;%define, --define, --force-define;; 44;input.at:2010;\"%define\" Boolean variables;; 45;input.at:2031;\"%define\" code variables;; 46;input.at:2064;\"%define\" keyword variables;; 47;input.at:2097;\"%define\" enum variables;; 48;input.at:2160;\"%define\" file variables;; 49;input.at:2182;\"%define\" backward compatibility;; 50;input.at:2228;Unused api.pure;; 51;input.at:2264;C++ namespace reference errors;; 52;input.at:2317;Bad character literals;; 53;input.at:2378;Bad escapes in literals;; 54;input.at:2427;LAC: Errors for %define;lac; 55;input.at:2481;-Werror combinations;; 56;input.at:2526;%name-prefix and api.prefix are incompatible;; 57;input.at:2555;Redefined %union name;; 58;input.at:2602;Stray \$ or @;; 59;input.at:2645;Code injection;; 60;input.at:2709;Deprecated directives;deprec; 61;input.at:2838;Unput's effect on locations;deprec; 62;input.at:2874;Non-deprecated directives;deprec; 63;input.at:2909;Cannot type action;; 64;input.at:2932;Character literals and api.token.raw;; 65;named-refs.at:22;Tutorial calculator;; 66;named-refs.at:196;Undefined and ambiguous references;; 67;named-refs.at:297;Misleading references;; 68;named-refs.at:316;Many kinds of errors;; 69;named-refs.at:551;Missing identifiers in brackets;; 70;named-refs.at:567;Redundant words in brackets;; 71;named-refs.at:583;Comments in brackets;; 72;named-refs.at:599;Stray symbols in brackets;; 73;named-refs.at:618;Redundant words in LHS brackets;; 74;named-refs.at:635;Factored LHS;; 75;named-refs.at:648;Unresolved references;; 76;named-refs.at:715;\$ or @ followed by . or -;; 77;output.at:66;Output files: -dv;; 78;output.at:74;Output files: -dv >&-;; 79;output.at:77;Output files: -dv -o foo.c;; 80;output.at:79;Output files: -dv -o foo.tab.c;; 81;output.at:82;Output files: -dv -g --xml --fixed-output-files;; 82;output.at:84;Output files: -dv -g --xml -y;; 83;output.at:86;Output files: %require \"3.4\" -dv -g --xml -y;; 84;output.at:89;Output files: -dv -g --xml -o y.tab.c;; 85;output.at:92;Output files: -dv -b bar;; 86;output.at:94;Output files: -dv -g -o foo.c;; 87;output.at:98;Output files: %defines %verbose ;; 88;output.at:100;Output files: %defines %verbose %yacc ;; 89;output.at:103;Output files: %defines %verbose %yacc ;; 90;output.at:107;Output files: %file-prefix \"bar\" %defines %verbose ;; 91;output.at:109;Output files: %output \"bar.c\" %defines %verbose %yacc ;; 92;output.at:113;Output files: %file-prefix \"baz\" %output \"bar.c\" %defines %verbose %yacc ;; 93;output.at:118;Output files: %defines %verbose ;; 94;output.at:121;Output files: %defines %verbose -o foo.c;; 95;output.at:125;Output files: --defines=foo.hpp -o foo.c++;; 96;output.at:129;Output files: %defines \"foo.hpp\" -o foo.c++;; 97;output.at:133;Output files: -o foo.c++ --graph=foo.gph;; 98;output.at:140;Output files: %type useless --defines --graph --xml --report=all -Wall -Werror;; 99;output.at:147;Output files: useless=--defines --graph --xml --report=all -Wall -Werror;; 100;output.at:161;Output files: lalr1.cc ;; 101;output.at:164;Output files: lalr1.cc %verbose ;; 102;output.at:167;Output files: lalr1.cc %defines %verbose ;; 103;output.at:170;Output files: lalr1.cc %verbose %locations ;; 104;output.at:173;Output files: lalr1.cc %defines %verbose %locations ;; 105;output.at:177;Output files: lalr1.cc %defines %verbose ;; 106;output.at:182;Output files: lalr1.cc %defines %verbose %locations -o subdir/foo.cc;; 107;output.at:187;Output files: lalr1.cc %defines %verbose %file-prefix \"output_dir/foo\" ;; 108;output.at:192;Output files: lalr1.cc %defines %locations %verbose %file-prefix \"output_dir/foo\" ;; 109;output.at:198;Output files: lalr1.cc %defines %locations api.location.file=none %require \"3.2\" ;; 110;output.at:203;Output files: lalr1.cc %defines %locations api.location.file=\"foo.loc.hh\" %require \"3.2\" ;; 111;output.at:209;Output files: lalr1.cc %defines %locations api.location.file=\"\$at_dir/foo.loc.hh\" %require \"3.2\" ;; 112;output.at:239;Conflicting output files: --graph=\"foo.tab.c\";; 113;output.at:244;Conflicting output files: %defines \"foo.output\" -v;; 114;output.at:249;Conflicting output files: lalr1.cc %defines %locations --graph=\"location.hh\";; 115;output.at:253;Conflicting output files: -o foo.y;; 116;output.at:297;Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .';c++; 117;output.at:304;Output file name: (;c++; 118;output.at:305;Output file name: );c++; 119;output.at:306;Output file name: #;c++; 120;output.at:307;Output file name: @@;c++; 121;output.at:308;Output file name: @{;c++; 122;output.at:309;Output file name: @};c++; 123;output.at:310;Output file name: [;c++; 124;output.at:311;Output file name: ];c++; 125;output.at:366;Graph with no conflicts;graph; 126;output.at:430;Graph with unsolved S/R;graph; 127;output.at:489;Graph with solved S/R;graph; 128;output.at:521;Graph with R/R;graph; 129;output.at:580;Graph with reductions with multiple LAT;graph; 130;output.at:674;Graph with a reduction rule both enabled and disabled;graph; 131;diagnostics.at:107;Warnings;diagnostics; 132;diagnostics.at:152;Single point locations;diagnostics; 133;diagnostics.at:193;Line is too short, and then you die;diagnostics; 134;diagnostics.at:211;Zero-width characters;diagnostics; 135;diagnostics.at:267;Tabulations and multibyte characters;diagnostics; 136;diagnostics.at:293;Special files;diagnostics; 137;diagnostics.at:316;Complaints from M4;diagnostics; 138;diagnostics.at:338;Carriage return;diagnostics; 139;diagnostics.at:366;CR NL;diagnostics; 140;diagnostics.at:405;Screen width: 200 columns;diagnostics; 141;diagnostics.at:438;Screen width: 80 columns;diagnostics; 142;diagnostics.at:471;Screen width: 60 columns;diagnostics; 143;diagnostics.at:495;Suggestions;diagnostics; 144;diagnostics.at:510;Indentation with message suppression;; 145;skeletons.at:25;Relative skeleton file names;; 146;skeletons.at:85;Installed skeleton file names;; 147;skeletons.at:142;Boolean=variables: invalid skeleton defaults;; 148;skeletons.at:166;Complaining during macro argument expansion;; 149;skeletons.at:248;Fatal errors make M4 exit immediately;; 150;skeletons.at:302;Fatal errors but M4 continues producing output;; 151;sets.at:27;Nullable;; 152;sets.at:111;Broken Closure;; 153;sets.at:153;Firsts;; 154;sets.at:228;Accept;; 155;sets.at:269;Build relations;; 156;sets.at:314;Reduced Grammar;; 157;sets.at:392;Reduced Grammar with prec and assoc;; 158;reduce.at:26;Useless Terminals;; 159;reduce.at:70;Useless Nonterminals;; 160;reduce.at:120;Useless Rules;report; 161;reduce.at:224;Useless Parts;; 162;reduce.at:312;Reduced Automaton;report; 163;reduce.at:406;Underivable Rules;report; 164;reduce.at:452;Empty Language;; 165;reduce.at:734;no lr.type: Single State Split;; 166;reduce.at:734;lr.type=lalr: Single State Split;; 167;reduce.at:734;lr.type=ielr: Single State Split;; 168;reduce.at:734;lr.type=canonical-lr: Single State Split;; 169;reduce.at:978;no lr.type: Lane Split;; 170;reduce.at:978;lr.type=lalr: Lane Split;; 171;reduce.at:978;lr.type=ielr: Lane Split;; 172;reduce.at:978;lr.type=canonical-lr: Lane Split;; 173;reduce.at:1247;no lr.type: Complex Lane Split;; 174;reduce.at:1247;lr.type=lalr: Complex Lane Split;; 175;reduce.at:1247;lr.type=ielr: Complex Lane Split;; 176;reduce.at:1247;lr.type=canonical-lr: Complex Lane Split;; 177;reduce.at:1549;no lr.type: Split During Added Lookahead Propagation;; 178;reduce.at:1549;lr.type=lalr: Split During Added Lookahead Propagation;; 179;reduce.at:1549;lr.type=ielr: Split During Added Lookahead Propagation;; 180;reduce.at:1549;lr.type=canonical-lr: Split During Added Lookahead Propagation;; 181;reduce.at:1694;no lr.default-reduction;; 182;reduce.at:1694;lr.default-reduction=most;; 183;reduce.at:1694;lr.default-reduction=consistent;; 184;reduce.at:1694;lr.default-reduction=accepting;; 185;report.at:24;Reports;report; 186;conflicts.at:28;Token declaration order;; 187;conflicts.at:101;Token declaration order: literals vs. identifiers;; 188;conflicts.at:183;Useless associativity warning;; 189;conflicts.at:218;Useless precedence warning;; 190;conflicts.at:275;S/R in initial;; 191;conflicts.at:301;%nonassoc and eof;; 192;conflicts.at:511;parse.error=verbose and consistent errors: lr.type=ielr;; 193;conflicts.at:516;parse.error=verbose and consistent errors: lr.type=ielr %glr-parser;glr; 194;conflicts.at:521;parse.error=verbose and consistent errors: lr.type=ielr c++;c++; 195;conflicts.at:526;parse.error=verbose and consistent errors: lr.type=ielr java;java; 196;conflicts.at:533;parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=consistent;; 197;conflicts.at:538;parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=accepting;; 198;conflicts.at:542;parse.error=verbose and consistent errors: lr.type=canonical-lr;; 199;conflicts.at:549;parse.error=verbose and consistent errors: lr.type=canonical-lr parse.lac=full;; 200;conflicts.at:554;parse.error=verbose and consistent errors: lr.type=ielr parse.lac=full;; 201;conflicts.at:562;parse.error=verbose and consistent errors: c++ lr.type=canonical-lr parse.lac=full;c++; 202;conflicts.at:568;parse.error=verbose and consistent errors: c++ lr.type=ielr parse.lac=full;c++; 203;conflicts.at:624;parse.error=verbose and consistent errors: ;; 204;conflicts.at:628;parse.error=verbose and consistent errors: %glr-parser;glr; 205;conflicts.at:634;parse.error=verbose and consistent errors: lr.default-reduction=consistent;; 206;conflicts.at:640;parse.error=verbose and consistent errors: lr.default-reduction=accepting;; 207;conflicts.at:644;parse.error=verbose and consistent errors: lr.type=canonical-lr;; 208;conflicts.at:649;parse.error=verbose and consistent errors: parse.lac=full;; 209;conflicts.at:654;parse.error=verbose and consistent errors: parse.lac=full lr.default-reduction=accepting;; 210;conflicts.at:675;LAC: %nonassoc requires splitting canonical LR states;; 211;conflicts.at:760;Unresolved SR Conflicts;report; 212;conflicts.at:868;Resolved SR Conflicts;report; 213;conflicts.at:970;%precedence suffices;; 214;conflicts.at:996;%precedence does not suffice;; 215;conflicts.at:1076;Syntax error in consistent error state: yacc.c;; 216;conflicts.at:1076;Syntax error in consistent error state: glr.c;glr; 217;conflicts.at:1076;Syntax error in consistent error state: lalr1.cc;c++; 218;conflicts.at:1076;Syntax error in consistent error state: glr.cc;glr c++; 219;conflicts.at:1107;Defaulted Conflicted Reduction;report; 220;conflicts.at:1229;%expect not enough;; 221;conflicts.at:1248;%expect right;; 222;conflicts.at:1265;%expect too much;; 223;conflicts.at:1284;%expect with reduce conflicts;; 224;conflicts.at:1303;%expect in grammar rule not enough;; 225;conflicts.at:1322;%expect in grammar rule right;; 226;conflicts.at:1339;%expect in grammar rules;; 227;conflicts.at:1358;%expect in grammar rule too much;; 228;conflicts.at:1377;%expect-rr in grammar rule;; 229;conflicts.at:1402;%expect-rr too much in grammar rule;; 230;conflicts.at:1431;%expect-rr not enough in grammar rule;; 231;conflicts.at:1460;%prec with user string;; 232;conflicts.at:1477;%no-default-prec without %prec;; 233;conflicts.at:1505;%no-default-prec with %prec;; 234;conflicts.at:1529;%default-prec;; 235;conflicts.at:1553;Unreachable States After Conflict Resolution;; 236;conflicts.at:1771;Solved conflicts report for multiple reductions in a state;; 237;conflicts.at:1851;%nonassoc error actions for multiple reductions in a state;; 238;conflicts.at:1920;%expect-rr non GLR;; 239;conflicts.at:1951;-W versus %expect and %expect-rr;; 240;synclines.at:207;Prologue syncline;; 241;synclines.at:228;%union syncline;; 242;synclines.at:237;%union name syncline;; 243;synclines.at:284;Postprologue syncline;; 244;synclines.at:303;Action syncline;; 245;synclines.at:321;Epilogue syncline;; 246;synclines.at:340;%code top syncline;; 247;synclines.at:363;%destructor syncline;; 248;synclines.at:388;%printer syncline;; 249;synclines.at:440;syncline escapes: yacc.c;; 250;synclines.at:440;syncline escapes: glr.c;glr; 251;synclines.at:440;syncline escapes: lalr1.cc;c++; 252;synclines.at:440;syncline escapes: glr.cc;glr c++; 253;synclines.at:497;%no-lines: yacc.c;; 254;synclines.at:497;%no-lines: glr.c;glr; 255;synclines.at:497;%no-lines: lalr1.cc;; 256;synclines.at:497;%no-lines: glr.cc;glr; 257;synclines.at:507;Output columns;; 258;headers.at:57;Invalid CPP guards: --defines=input/input.h;; 259;headers.at:58;Invalid CPP guards: --defines=9foo.h;; 260;headers.at:59;Invalid CPP guards: %glr-parser --defines=input/input.h;glr; 261;headers.at:60;Invalid CPP guards: %glr-parser --defines=9foo.h;glr; 262;headers.at:68;export YYLTYPE;; 263;headers.at:176;Sane headers: ;; 264;headers.at:177;Sane headers: %locations %debug;; 265;headers.at:179;Sane headers: %glr-parser;glr; 266;headers.at:180;Sane headers: %locations %debug %glr-parser;glr; 267;headers.at:182;Sane headers: api.pure;; 268;headers.at:183;Sane headers: api.push-pull=both;; 269;headers.at:184;Sane headers: api.pure api.push-pull=both;; 270;headers.at:186;Sane headers: c++;c++; 271;headers.at:187;Sane headers: %locations %debug c++;c++; 272;headers.at:188;Sane headers: c++ api.value.type=variant parse.assert;c++; 273;headers.at:190;Sane headers: %locations c++ %glr-parser;glr c++; 274;headers.at:198;Several parsers;glr c++; 275;actions.at:24;Midrule actions;; 276;actions.at:72;Typed midrule actions;; 277;actions.at:122;Implicitly empty rule;; 278;actions.at:172;Invalid uses of %empty;; 279;actions.at:240;Valid uses of %empty;; 280;actions.at:270;Add missing %empty;; 281;actions.at:365;Initial location: yacc.c ;; 282;actions.at:366;Initial location: yacc.c api.pure=full;; 283;actions.at:367;Initial location: yacc.c api.pure %parse-param { int x };; 284;actions.at:368;Initial location: yacc.c api.push-pull=both;; 285;actions.at:369;Initial location: yacc.c api.push-pull=both api.pure=full;; 286;actions.at:370;Initial location: glr.c ;glr; 287;actions.at:371;Initial location: glr.c api.pure;glr; 288;actions.at:372;Initial location: lalr1.cc ;c++; 289;actions.at:373;Initial location: glr.cc ;glr c++; 290;actions.at:391;Initial location: yacc.c api.pure=full;; 291;actions.at:402;Initial location: yacc.c api.pure=full;; 292;actions.at:477;Location print: yacc.c ;; 293;actions.at:477;Location print: glr.c ;glr; 294;actions.at:477;Location print: lalr1.cc ;c++; 295;actions.at:477;Location print: glr.cc ;glr c++; 296;actions.at:487;Exotic Dollars;; 297;actions.at:1047;Printers and Destructors;; 298;actions.at:1048;Printers and Destructors with union;; 299;actions.at:1050;Printers and Destructors: %glr-parser;glr; 300;actions.at:1051;Printers and Destructors with union: %glr-parser;glr; 301;actions.at:1053;Printers and Destructors: %defines lalr1.cc;c++; 302;actions.at:1054;Printers and Destructors with union: %defines lalr1.cc;c++; 303;actions.at:1056;Printers and Destructors: %defines glr.cc;glr c++; 304;actions.at:1057;Printers and Destructors with union: %defines glr.cc;glr c++; 305;actions.at:1068;Default tagless %printer and %destructor;; 306;actions.at:1161;Default tagged and per-type %printer and %destructor;; 307;actions.at:1280;Default %printer and %destructor for user-defined end token;; 308;actions.at:1390;Default %printer and %destructor are not for error or \$undefined;; 309;actions.at:1483;Default %printer and %destructor are not for \$accept;; 310;actions.at:1547;Default %printer and %destructor for midrule values;; 311;actions.at:1692;@\$ in %initial-action implies %locations;; 312;actions.at:1693;@\$ in %destructor implies %locations;; 313;actions.at:1694;@\$ in %printer implies %locations;; 314;actions.at:1808;Qualified \$\$ in actions: yacc.c;; 315;actions.at:1808;Qualified \$\$ in actions: glr.c;glr; 316;actions.at:1808;Qualified \$\$ in actions: lalr1.cc;c++; 317;actions.at:1808;Qualified \$\$ in actions: glr.cc;glr c++; 318;actions.at:1815;Destroying lookahead assigned by semantic action;; 319;actions.at:1870;YYBACKUP;; 320;types.at:25;%union vs. api.value.type;; 321;types.at:44;%yacc vs. api.value.type=union;; 322;types.at:366;yacc.c api.value.type={double};api.value.type; 323;types.at:366;yacc.c api.value.type={double} %defines;api.value.type; 324;types.at:366;yacc.c api.value.type={variant};api.value.type; 325;types.at:366;yacc.c api.value.type={variant} %defines;api.value.type; 326;types.at:366;yacc.c api.value.type={struct foo};api.value.type; 327;types.at:366;yacc.c api.value.type={struct foo} %defines;api.value.type; 328;types.at:366;yacc.c api.value.type={struct bar};api.value.type; 329;types.at:366;yacc.c api.value.type={struct bar} %defines;api.value.type; 330;types.at:366;yacc.c api.value.type={union foo};api.value.type; 331;types.at:366;yacc.c api.value.type={union foo} %defines;api.value.type; 332;types.at:366;yacc.c %union { float fval; int ival; };;api.value.type; 333;types.at:366;yacc.c %union { float fval; int ival; }; %defines;api.value.type; 334;types.at:366;yacc.c %union foo { float fval; int ival; };;api.value.type; 335;types.at:366;yacc.c %union foo { float fval; int ival; }; %defines;api.value.type; 336;types.at:366;yacc.c api.value.union.name=foo; %union { float fval; int ival; };;api.value.type; 337;types.at:366;yacc.c api.value.union.name=foo; %union { float fval; int ival; }; %defines;api.value.type; 338;types.at:366;yacc.c api.value.type=union;api.value.type; 339;types.at:366;yacc.c api.value.type=union %defines;api.value.type; 340;types.at:366;glr.c api.value.type={double};api.value.type glr; 341;types.at:366;glr.c api.value.type={double} %defines;api.value.type glr; 342;types.at:366;glr.c api.value.type={variant};api.value.type glr; 343;types.at:366;glr.c api.value.type={variant} %defines;api.value.type glr; 344;types.at:366;glr.c api.value.type={struct foo};api.value.type glr; 345;types.at:366;glr.c api.value.type={struct foo} %defines;api.value.type glr; 346;types.at:366;glr.c api.value.type={struct bar};api.value.type glr; 347;types.at:366;glr.c api.value.type={struct bar} %defines;api.value.type glr; 348;types.at:366;glr.c api.value.type={union foo};api.value.type glr; 349;types.at:366;glr.c api.value.type={union foo} %defines;api.value.type glr; 350;types.at:366;glr.c %union { float fval; int ival; };;api.value.type glr; 351;types.at:366;glr.c %union { float fval; int ival; }; %defines;api.value.type glr; 352;types.at:366;glr.c %union foo { float fval; int ival; };;api.value.type glr; 353;types.at:366;glr.c %union foo { float fval; int ival; }; %defines;api.value.type glr; 354;types.at:366;glr.c api.value.union.name=foo; %union { float fval; int ival; };;api.value.type glr; 355;types.at:366;glr.c api.value.union.name=foo; %union { float fval; int ival; }; %defines;api.value.type glr; 356;types.at:366;glr.c api.value.type=union;api.value.type glr; 357;types.at:366;glr.c api.value.type=union %defines;api.value.type glr; 358;types.at:366;lalr1.cc api.value.type={double};api.value.type c++; 359;types.at:366;lalr1.cc api.value.type={double} %defines;api.value.type c++; 360;types.at:366;lalr1.cc api.value.type={variant};api.value.type c++; 361;types.at:366;lalr1.cc api.value.type={variant} %defines;api.value.type c++; 362;types.at:366;lalr1.cc api.value.type={struct foo};api.value.type c++; 363;types.at:366;lalr1.cc api.value.type={struct foo} %defines;api.value.type c++; 364;types.at:366;lalr1.cc api.value.type={struct bar};api.value.type c++; 365;types.at:366;lalr1.cc api.value.type={struct bar} %defines;api.value.type c++; 366;types.at:366;lalr1.cc api.value.type={union foo};api.value.type c++; 367;types.at:366;lalr1.cc api.value.type={union foo} %defines;api.value.type c++; 368;types.at:366;lalr1.cc %union { float fval; int ival; };;api.value.type c++; 369;types.at:366;lalr1.cc %union { float fval; int ival; }; %defines;api.value.type c++; 370;types.at:366;lalr1.cc api.value.type=union;api.value.type c++; 371;types.at:366;lalr1.cc api.value.type=union %defines;api.value.type c++; 372;types.at:366;lalr1.cc api.value.type=variant;api.value.type c++; 373;types.at:366;lalr1.cc api.value.type=variant %defines;api.value.type c++; 374;types.at:366;lalr1.cc api.value.type=variant;api.value.type c++; 375;types.at:366;lalr1.cc api.value.type=variant %defines;api.value.type c++; 376;types.at:366;lalr1.cc api.value.type=variant api.token.constructor;api.value.type c++; 377;types.at:366;lalr1.cc api.value.type=variant api.token.constructor %defines;api.value.type c++; 378;types.at:366;lalr1.cc %code requires { #include } api.value.type=variant;api.value.type c++; 379;types.at:366;lalr1.cc %code requires { #include } api.value.type=variant %defines;api.value.type c++; 380;types.at:366;lalr1.cc %code requires { #include } api.value.type=variant api.token.constructor;api.value.type c++; 381;types.at:366;lalr1.cc %code requires { #include } api.value.type=variant api.token.constructor %defines;api.value.type c++; 382;types.at:366;lalr1.cc %code requires { #include } api.value.type=variant api.token.constructor;api.value.type c++; 383;types.at:366;lalr1.cc %code requires { #include } api.value.type=variant api.token.constructor %defines;api.value.type c++; 384;types.at:366;glr.cc api.value.type={double};api.value.type glr c++; 385;types.at:366;glr.cc api.value.type={double} %defines;api.value.type glr c++; 386;types.at:366;glr.cc api.value.type={variant};api.value.type glr c++; 387;types.at:366;glr.cc api.value.type={variant} %defines;api.value.type glr c++; 388;types.at:366;glr.cc api.value.type={struct foo};api.value.type glr c++; 389;types.at:366;glr.cc api.value.type={struct foo} %defines;api.value.type glr c++; 390;types.at:366;glr.cc api.value.type={struct bar};api.value.type glr c++; 391;types.at:366;glr.cc api.value.type={struct bar} %defines;api.value.type glr c++; 392;types.at:366;glr.cc api.value.type={union foo};api.value.type glr c++; 393;types.at:366;glr.cc api.value.type={union foo} %defines;api.value.type glr c++; 394;types.at:366;glr.cc %union { float fval; int ival; };;api.value.type glr c++; 395;types.at:366;glr.cc %union { float fval; int ival; }; %defines;api.value.type glr c++; 396;types.at:366;glr.cc api.value.type=union;api.value.type glr c++; 397;types.at:366;glr.cc api.value.type=union %defines;api.value.type glr c++; 398;types.at:388;lalr1.cc: Named %union;; 399;types.at:388;glr.cc: Named %union;; 400;scanner.at:338;Token numbers: yacc.c;; 401;scanner.at:338;Token numbers: yacc.c api.token.raw;; 402;scanner.at:338;Token numbers: glr.c;glr; 403;scanner.at:338;Token numbers: glr.c api.token.raw;glr; 404;scanner.at:338;Token numbers: lalr1.cc;c++; 405;scanner.at:338;Token numbers: lalr1.cc api.token.raw;c++; 406;scanner.at:338;Token numbers: glr.cc;glr c++; 407;scanner.at:338;Token numbers: glr.cc api.token.raw;glr c++; 408;scanner.at:338;Token numbers: lalr1.java;java; 409;scanner.at:338;Token numbers: lalr1.java api.token.raw;java; 410;scanner.at:338;Token numbers: lalr1.d;d; 411;scanner.at:338;Token numbers: lalr1.d api.token.raw;d; 412;scanner.at:340;Token numbers: lalr1.cc api.token.raw api.value.type=variant api.token.constructor;c++; 413;calc.at:750;Calculator ;; 414;calc.at:752;Calculator %defines ;; 415;calc.at:753;Calculator %locations ;; 416;calc.at:754;Calculator %locations api.location.type={Span} ;; 417;calc.at:756;Calculator %name-prefix \"calc\" ;; 418;calc.at:757;Calculator %verbose ;; 419;calc.at:758;Calculator %yacc ;; 420;calc.at:759;Calculator parse.error=verbose ;; 421;calc.at:761;Calculator api.pure=full %locations ;; 422;calc.at:762;Calculator api.push-pull=both api.pure=full %locations ;; 423;calc.at:763;Calculator parse.error=verbose %locations ;; 424;calc.at:765;Calculator parse.error=verbose %locations %defines api.prefix={calc} %verbose %yacc ;; 425;calc.at:766;Calculator parse.error=verbose %locations %defines %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc ;; 426;calc.at:768;Calculator %debug ;; 427;calc.at:769;Calculator parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc ;; 428;calc.at:770;Calculator parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc ;; 429;calc.at:772;Calculator api.pure=full parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc ;; 430;calc.at:773;Calculator api.push-pull=both api.pure=full parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc ;; 431;calc.at:775;Calculator api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;; 432;calc.at:777;Calculator %no-lines api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;; 433;calc.at:793;Calculator %glr-parser ;glr; 434;calc.at:795;Calculator %glr-parser %defines ;glr; 435;calc.at:796;Calculator %glr-parser %locations ;glr; 436;calc.at:797;Calculator %glr-parser %locations api.location.type={Span} ;glr; 437;calc.at:798;Calculator %glr-parser %name-prefix \"calc\" ;glr; 438;calc.at:799;Calculator %glr-parser api.prefix={calc} ;glr; 439;calc.at:800;Calculator %glr-parser %verbose ;glr; 440;calc.at:801;Calculator %glr-parser %yacc ;glr; 441;calc.at:802;Calculator %glr-parser parse.error=verbose ;glr; 442;calc.at:804;Calculator %glr-parser api.pure %locations ;glr; 443;calc.at:805;Calculator %glr-parser parse.error=verbose %locations ;glr; 444;calc.at:807;Calculator %glr-parser parse.error=verbose %locations %defines %name-prefix \"calc\" %verbose %yacc ;glr; 445;calc.at:809;Calculator %glr-parser %debug ;glr; 446;calc.at:810;Calculator %glr-parser parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc ;glr; 447;calc.at:811;Calculator %glr-parser parse.error=verbose %debug %locations %defines api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc ;glr; 448;calc.at:813;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc ;glr; 449;calc.at:815;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;glr; 450;calc.at:816;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;glr; 451;calc.at:818;Calculator %glr-parser %no-lines api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;glr; 452;calc.at:828;Calculator lalr1.cc %defines ;c++; 453;calc.at:837;Calculator C++ ;c++; 454;calc.at:838;Calculator C++ %locations ;c++; 455;calc.at:839;Calculator C++ %locations \$NO_EXCEPTIONS_CXXFLAGS;c++; 456;calc.at:840;Calculator C++ %locations api.location.type={Span} ;c++; 457;calc.at:841;Calculator C++ %defines %locations parse.error=verbose %name-prefix \"calc\" %verbose %yacc ;c++; 458;calc.at:843;Calculator C++ %locations parse.error=verbose api.prefix={calc} %verbose %yacc ;c++; 459;calc.at:844;Calculator C++ %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc ;c++; 460;calc.at:846;Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc ;c++; 461;calc.at:847;Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc ;c++; 462;calc.at:849;Calculator C++ %defines %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;c++; 463;calc.at:851;Calculator C++ parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;c++; 464;calc.at:852;Calculator C++ %defines %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;c++; 465;calc.at:854;Calculator C++ %defines %locations api.location.file=none ;c++; 466;calc.at:855;Calculator C++ %defines %locations api.location.file=\"my-location.hh\" ;c++; 467;calc.at:857;Calculator C++ %no-lines %defines %locations api.location.file=\"my-location.hh\" ;c++; 468;calc.at:867;Calculator glr.cc ;glr c++; 469;calc.at:876;Calculator C++ %glr-parser ;glr c++; 470;calc.at:877;Calculator C++ %glr-parser %locations ;glr c++; 471;calc.at:878;Calculator C++ %glr-parser %locations api.location.type={Span} ;glr c++; 472;calc.at:879;Calculator C++ %glr-parser %defines parse.error=verbose %name-prefix \"calc\" %verbose %yacc ;glr c++; 473;calc.at:880;Calculator C++ %glr-parser parse.error=verbose api.prefix={calc} %verbose %yacc ;glr c++; 474;calc.at:882;Calculator C++ %glr-parser %debug ;glr c++; 475;calc.at:884;Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc ;glr c++; 476;calc.at:885;Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc ;glr c++; 477;calc.at:887;Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;glr c++; 478;calc.at:888;Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;glr c++; 479;calc.at:890;Calculator C++ %glr-parser %no-lines %locations %defines parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} ;glr c++; 480;calc.at:900;Calculator lalr1.d ;d; 481;calc.at:909;Calculator D ;d; 482;calc.at:910;Calculator D %locations ;d; 483;calc.at:912;Calculator D parse.error=verbose api.prefix={calc} %verbose ;d; 484;calc.at:914;Calculator D %debug ;d; 485;calc.at:916;Calculator D parse.error=verbose %debug %verbose ;d; 486;torture.at:132;Big triangle;; 487;torture.at:216;Big horizontal;; 488;torture.at:270;State number type: 128 states;; 489;torture.at:271;State number type: 129 states;; 490;torture.at:272;State number type: 256 states;; 491;torture.at:273;State number type: 257 states;; 492;torture.at:274;State number type: 32768 states;; 493;torture.at:275;State number type: 65536 states;; 494;torture.at:276;State number type: 65537 states;; 495;torture.at:385;Many lookahead tokens;; 496;torture.at:487;Exploding the Stack Size with Alloca;; 497;torture.at:533;Exploding the Stack Size with Malloc;; 498;existing.at:801;GNU AWK 3.1.0 Grammar: LALR(1);; 499;existing.at:801;GNU AWK 3.1.0 Grammar: IELR(1);; 500;existing.at:801;GNU AWK 3.1.0 Grammar: Canonical LR(1);; 501;existing.at:1453;GNU Cim Grammar: LALR(1);; 502;existing.at:1453;GNU Cim Grammar: IELR(1);; 503;existing.at:1453;GNU Cim Grammar: Canonical LR(1);; 504;existing.at:3266;GNU pic (Groff 1.18.1) Grammar: LALR(1);; 505;existing.at:3266;GNU pic (Groff 1.18.1) Grammar: IELR(1);; 506;existing.at:3266;GNU pic (Groff 1.18.1) Grammar: Canonical LR(1);; 507;regression.at:25;Trivial grammars;; 508;regression.at:55;YYSTYPE typedef;; 509;regression.at:85;Early token definitions with --yacc;; 510;regression.at:127;Early token definitions without --yacc;; 511;regression.at:172;Braces parsing;; 512;regression.at:195;Rule Line Numbers;report; 513;regression.at:344;Mixing %token styles;; 514;regression.at:370;Token definitions;; 515;regression.at:431;Characters Escapes;; 516;regression.at:464;Web2c Report;report; 517;regression.at:645;Web2c Actions;report; 518;regression.at:834;Dancer ;; 519;regression.at:835;Dancer %glr-parser;glr; 520;regression.at:836;Dancer lalr1.cc;c++; 521;regression.at:911;Expecting two tokens ;; 522;regression.at:912;Expecting two tokens %glr-parser;glr; 523;regression.at:913;Expecting two tokens lalr1.cc;c++; 524;regression.at:921;Braced code in declaration in rules section;; 525;regression.at:980;String alias declared after use;; 526;regression.at:1003;Extra lookahead sets in report;; 527;regression.at:1044;Token number in precedence declaration;; 528;regression.at:1097;parse-gram.y: LALR = IELR;; 529;regression.at:1119;parse.error=verbose and YYSTACK_USE_ALLOCA;; 530;regression.at:1193;parse.error=verbose overflow;; 531;regression.at:1303;LAC: Exploratory stack;lac c++; 532;regression.at:1389;LAC: Memory exhaustion;lac; 533;regression.at:1519;Lex and parse params: yacc.c;; 534;regression.at:1520;Lex and parse params: glr.c;glr; 535;regression.at:1521;Lex and parse params: lalr1.cc;c++; 536;regression.at:1522;Lex and parse params: glr.cc;glr c++; 537;regression.at:1533;stdio.h is not needed;; 538;push.at:25;Memory Leak for Early Deletion;; 539;push.at:84;Multiple impure instances;; 540;push.at:145;Unsupported Skeletons;; 541;c++.at:26;C++ Locations Unit Tests;c++; 542;c++.at:100;C++ Variant-based Symbols Unit Tests;variant c++; 543;c++.at:233;Multiple occurrences of \$n and api.value.automove;; 544;c++.at:552;Variants lalr1.cc;variant c++; 545;c++.at:553;Variants lalr1.cc parse.assert;variant c++; 546;c++.at:554;Variants lalr1.cc parse.assert api.value.automove;variant c++; 547;c++.at:555;Variants lalr1.cc parse.assert %locations;variant c++; 548;c++.at:556;Variants lalr1.cc parse.assert %code {\\n#define TWO_STAGE_BUILD\\n};variant c++; 549;c++.at:557;Variants lalr1.cc parse.assert api.token.constructor;variant c++; 550;c++.at:558;Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_};variant c++; 551;c++.at:559;Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations;variant c++; 552;c++.at:560;Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations api.value.automove;variant c++; 553;c++.at:570;Variants and Typed Midrule Actions;c++; 554;c++.at:772;Doxygen Public Documentation;; 555;c++.at:773;Doxygen Private Documentation;; 556;c++.at:828;Relative namespace references;c++; 557;c++.at:834;Absolute namespace references;c++; 558;c++.at:843;Syntactically invalid namespace references;; 559;c++.at:864;Syntax error discarding no lookahead;c++; 560;c++.at:1043;Syntax error as exception: lalr1.cc;c++; 561;c++.at:1044;Syntax error as exception: glr.cc;glr c++; 562;c++.at:1338;Exception safety with error recovery ;c++; 563;c++.at:1339;Exception safety without error recovery ;c++; 564;c++.at:1340;Exception safety with error recovery api.value.type=variant;c++; 565;c++.at:1341;Exception safety without error recovery api.value.type=variant;c++; 566;c++.at:1349;C++ GLR parser identifier shadowing;c++; 567;c++.at:1400;Shared locations;c++; 568;c++.at:1495;Default action;action c++; 569;java.at:25;Java invalid directives;; 570;java.at:351;Calculator ;java; 571;java.at:351;Calculator parse.error=verbose ;java; 572;java.at:351;Calculator %locations ;java; 573;java.at:351;Calculator parse.error=verbose %locations ;java; 574;java.at:358;Calculator %lex-param { InputStream is } ;java; 575;java.at:358;Calculator parse.error=verbose %lex-param { InputStream is } ;java; 576;java.at:358;Calculator %locations %lex-param { InputStream is } ;java; 577;java.at:358;Calculator parse.error=verbose %locations %lex-param { InputStream is } ;java; 578;java.at:439;Java parser class and package names;java; 579;java.at:466;Java parser class modifiers;java; 580;java.at:530;Java parser class extends and implements;java; 581;java.at:550;Java %parse-param and %lex-param;java; 582;java.at:624;Java throws specifications;java; 583;java.at:713;Java constructor init and init_throws;java; 584;java.at:740;Java value, position, and location types;java; 585;java.at:771;Java syntax error handling without error token;java; 586;javapush.at:171;Trivial Push Parser with api.push-pull verification;java; 587;javapush.at:216;Trivial Push Parser with %initial-action;java; 588;javapush.at:324;Calc parser with api.push-pull both;java; 589;javapush.at:621;Calc parser with %locations %code lexer and api.push-pull both;java; 590;cxx-type.at:390;GLR: Resolve ambiguity, impure, no locations;glr; 591;cxx-type.at:397;GLR: Resolve ambiguity, impure, locations;glr; 592;cxx-type.at:403;GLR: Resolve ambiguity, pure, no locations;glr; 593;cxx-type.at:410;GLR: Resolve ambiguity, pure, locations;glr; 594;cxx-type.at:417;GLR: Merge conflicting parses, impure, no locations;glr; 595;cxx-type.at:424;GLR: Merge conflicting parses, impure, locations;glr; 596;cxx-type.at:431;GLR: Merge conflicting parses, pure, no locations;glr; 597;cxx-type.at:437;GLR: Merge conflicting parses, pure, locations;glr; 598;cxx-type.at:444;GLR: Verbose messages, resolve ambiguity, impure, no locations;glr; 599;glr-regression.at:25;Badly Collapsed GLR States;; 600;glr-regression.at:112;Improper handling of embedded actions and dollar(-N) in GLR parsers;; 601;glr-regression.at:248;Improper merging of GLR delayed action sets;; 602;glr-regression.at:370;Duplicate representation of merged trees;; 603;glr-regression.at:462;User destructor for unresolved GLR semantic value;; 604;glr-regression.at:519;User destructor after an error during a split parse;; 605;glr-regression.at:570;Duplicated user destructor for lookahead;; 606;glr-regression.at:660;Incorrectly initialized location for empty right-hand side in GLR;; 607;glr-regression.at:750;No users destructors if stack 0 deleted;; 608;glr-regression.at:828;Corrupted semantic options if user action cuts parse;; 609;glr-regression.at:883;Undesirable destructors if user action cuts parse;; 610;glr-regression.at:942;Leaked semantic values if user action cuts parse;; 611;glr-regression.at:1066;Incorrect lookahead during deterministic GLR;; 612;glr-regression.at:1191;Incorrect lookahead during nondeterministic GLR;; 613;glr-regression.at:1408;Leaked semantic values when reporting ambiguity;; 614;glr-regression.at:1491;Leaked lookahead after nondeterministic parse syntax error;; 615;glr-regression.at:1552;Uninitialized location when reporting ambiguity;glr; 616;glr-regression.at:1627;Missed %merge type warnings when LHS type is declared later;; 617;glr-regression.at:1676;Ambiguity reports;; 618;glr-regression.at:1778;Predicates;; " # List of the all the test groups. at_groups_all=`$as_echo "$at_help_all" | sed 's/;.*//'` # at_fn_validate_ranges NAME... # ----------------------------- # Validate and normalize the test group number contained in each variable # NAME. Leading zeroes are treated as decimal. at_fn_validate_ranges () { for at_grp do eval at_value=\$$at_grp if test $at_value -lt 1 || test $at_value -gt 618; 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 3.5.4 test suite test groups: NUM: FILE-NAME:LINE TEST-GROUP-NAME KEYWORDS _ATEOF # Pass an empty line as separator between selected groups and help. $as_echo "$at_groups$as_nl$as_nl$at_help_all" | awk 'NF == 1 && FS != ";" { selected[$ 1] = 1 next } /^$/ { FS = ";" } NF > 0 { if (selected[$ 1]) { printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3 if ($ 4) { lmax = 79 indent = " " line = indent len = length (line) n = split ($ 4, a, " ") for (i = 1; i <= n; i++) { l = length (a[i]) + 1 if (i > 1 && len + l > lmax) { print line line = indent " " a[i] len = length (line) } else { line = line " " a[i] len += l } } if (n) print line } } }' || at_write_fail=1 exit $at_write_fail fi if $at_version_p; then $as_echo "$as_me (GNU Bison 3.5.4)" && cat <<\_ATEOF || at_write_fail=1 Copyright (C) 2012 Free Software Foundation, Inc. This test suite is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ATEOF exit $at_write_fail fi # Should we print banners? Yes if more than one test is run. case $at_groups in #( *$as_nl* ) at_print_banners=: ;; #( * ) at_print_banners=false ;; esac # Text for banner N, set to a single space once printed. # Banner 1. input.at:18 # Category starts at test group 1. at_banner_text_1="Input Processing." # Banner 2. named-refs.at:19 # Category starts at test group 65. at_banner_text_2="Named references tests." # Banner 3. output.at:19 # Category starts at test group 77. at_banner_text_3="Output file names." # Banner 4. diagnostics.at:18 # Category starts at test group 131. at_banner_text_4="Diagnostics." # Banner 5. skeletons.at:19 # Category starts at test group 145. at_banner_text_5="Skeleton Support." # Banner 6. sets.at:20 # Category starts at test group 151. at_banner_text_6="Grammar Sets (Firsts etc.)." # Banner 7. reduce.at:19 # Category starts at test group 158. at_banner_text_7="Grammar Reduction." # Banner 8. report.at:18 # Category starts at test group 185. at_banner_text_8="Test reports." # Banner 9. conflicts.at:19 # Category starts at test group 186. at_banner_text_9="Conflicts." # Banner 10. synclines.at:19 # Category starts at test group 240. at_banner_text_10="Sync Lines." # Banner 11. headers.at:19 # Category starts at test group 258. at_banner_text_11="Parser Headers." # Banner 12. actions.at:18 # Category starts at test group 275. at_banner_text_12="User Actions." # Banner 13. types.at:18 # Category starts at test group 320. at_banner_text_13="Value type tests." # Banner 14. scanner.at:18 # Category starts at test group 400. at_banner_text_14="Interface with the scanner." # Banner 15. calc.at:741 # Category starts at test group 413. at_banner_text_15="Simple LALR(1) Calculator." # Banner 16. calc.at:783 # Category starts at test group 433. at_banner_text_16="Simple GLR Calculator." # Banner 17. calc.at:825 # Category starts at test group 452. at_banner_text_17="Simple LALR(1) C++ Calculator." # Banner 18. calc.at:864 # Category starts at test group 468. at_banner_text_18="Simple GLR C++ Calculator." # Banner 19. calc.at:897 # Category starts at test group 480. at_banner_text_19="Simple LALR(1) D Calculator." # Banner 20. torture.at:19 # Category starts at test group 486. at_banner_text_20="Torture Tests." # Banner 21. existing.at:19 # Category starts at test group 498. at_banner_text_21="Existing Grammars." # Banner 22. regression.at:18 # Category starts at test group 507. at_banner_text_22="Regression tests." # Banner 23. push.at:19 # Category starts at test group 538. at_banner_text_23="Push Parsing Tests" # Banner 24. c++.at:19 # Category starts at test group 541. at_banner_text_24="C++ Features." # Banner 25. java.at:18 # Category starts at test group 569. at_banner_text_25="Java Calculator." # Banner 26. java.at:366 # Category starts at test group 578. at_banner_text_26="Java Parameters." # Banner 27. javapush.at:41 # Category starts at test group 586. at_banner_text_27="Java Push Parsing Tests" # Banner 28. cxx-type.at:18 # Category starts at test group 590. at_banner_text_28="C++ Type Syntax (GLR)." # Banner 29. glr-regression.at:19 # Category starts at test group 599. at_banner_text_29="GLR Regression Tests" # Take any -C into account. if $at_change_dir ; then test x != "x$at_dir" && cd "$at_dir" \ || as_fn_error $? "unable to change directory" at_dir=`pwd` fi # Load the config files for any default variable assignments. for at_file in atconfig atlocal do test -r $at_file || continue . ./$at_file || as_fn_error $? "invalid content: $at_file" done # Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix: : "${at_top_build_prefix=$at_top_builddir}" # Perform any assignments requested during argument parsing. eval "$at_debug_args" # atconfig delivers names relative to the directory the test suite is # in, but the groups themselves are run in testsuite-dir/group-dir. if test -n "$at_top_srcdir"; then builddir=../.. for at_dir_var in srcdir top_srcdir top_build_prefix do eval at_val=\$at_$at_dir_var case $at_val in [\\/$]* | ?:[\\/]* ) at_prefix= ;; *) at_prefix=../../ ;; esac eval "$at_dir_var=\$at_prefix\$at_val" done fi ## -------------------- ## ## Directory structure. ## ## -------------------- ## # This is the set of directories and files used by this script # (non-literals are capitalized): # # TESTSUITE - the testsuite # TESTSUITE.log - summarizes the complete testsuite run # TESTSUITE.dir/ - created during a run, remains after -d or failed test # + at-groups/ - during a run: status of all groups in run # | + NNN/ - during a run: meta-data about test group NNN # | | + check-line - location (source file and line) of current AT_CHECK # | | + status - exit status of current AT_CHECK # | | + stdout - stdout of current AT_CHECK # | | + stder1 - stderr, including trace # | | + stderr - stderr, with trace filtered out # | | + test-source - portion of testsuite that defines group # | | + times - timestamps for computing duration # | | + pass - created if group passed # | | + xpass - created if group xpassed # | | + fail - created if group failed # | | + xfail - created if group xfailed # | | + skip - created if group skipped # + at-stop - during a run: end the run if this file exists # + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction # + 0..NNN/ - created for each group NNN, remains after -d or failed test # | + TESTSUITE.log - summarizes the group results # | + ... - files created during the group # The directory the whole suite works in. # Should be absolute to let the user `cd' at will. at_suite_dir=$at_dir/$as_me.dir # The file containing the suite ($at_dir might have changed since earlier). at_suite_log=$at_dir/$as_me.log # The directory containing helper files per test group. at_helper_dir=$at_suite_dir/at-groups # Stop file: if it exists, do not start new jobs. at_stop_file=$at_suite_dir/at-stop # The fifo used for the job dispatcher. at_job_fifo=$at_suite_dir/at-job-fifo if $at_clean; then test -d "$at_suite_dir" && find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \; rm -f -r "$at_suite_dir" "$at_suite_log" exit $? fi # Don't take risks: use only absolute directories in PATH. # # For stand-alone test suites (ie. atconfig was not found), # AUTOTEST_PATH is relative to `.'. # # For embedded test suites, AUTOTEST_PATH is relative to the top level # of the package. Then expand it into build/src parts, since users # may create executables in both places. AUTOTEST_PATH=`$as_echo "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"` at_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $AUTOTEST_PATH $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR case $as_dir in [\\/]* | ?:[\\/]* ) as_fn_append at_path "$as_dir" ;; * ) if test -z "$at_top_build_prefix"; then # Stand-alone test suite. as_fn_append at_path "$as_dir" else # Embedded test suite. as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR" as_fn_append at_path "$at_top_srcdir/$as_dir" fi ;; esac done IFS=$as_save_IFS # Now build and simplify PATH. # # There might be directories that don't exist, but don't redirect # builtins' (eg., cd) stderr directly: Ultrix's sh hates that. at_new_path= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $at_path do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -d "$as_dir" || continue case $as_dir in [\\/]* | ?:[\\/]* ) ;; * ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;; esac case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in *$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;; $PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;; *) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;; esac done IFS=$as_save_IFS PATH=$at_new_path export PATH # Setting up the FDs. # 5 is the log file. Not to be overwritten if `-d'. if $at_debug_p; then at_suite_log=/dev/null else : >"$at_suite_log" fi exec 5>>"$at_suite_log" # Banners and logs. $as_echo "## --------------------------- ## ## GNU Bison 3.5.4 test suite. ## ## --------------------------- ##" { $as_echo "## --------------------------- ## ## GNU Bison 3.5.4 test suite. ## ## --------------------------- ##" echo $as_echo "$as_me: command line was:" $as_echo " \$ $0 $at_cli_args" echo # If ChangeLog exists, list a few lines in case it might help determining # the exact version. if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then $as_echo "## ---------- ## ## ChangeLog. ## ## ---------- ##" echo sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog" echo fi { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } echo # Contents of the config files. for at_file in atconfig atlocal do test -r $at_file || continue $as_echo "$as_me: $at_file:" sed 's/^/| /' $at_file echo done } >&5 at_save_special_files () { for at_save_file in stderr experr expout do test ! -f at-bison-check-$at_save_file.bak || as_fn_error 1 "fatal error: back-up on top of a back-up" test ! -f $at_save_file || mv $at_save_file at-bison-check-$at_save_file.bak done } at_restore_special_files () { for at_save_file in stderr experr expout do test ! -f at-bison-check-$at_save_file.bak || mv at-bison-check-$at_save_file.bak $at_save_file done } ## ------------------------- ## ## Autotest shell functions. ## ## ------------------------- ## # at_fn_banner NUMBER # ------------------- # Output banner NUMBER, provided the testsuite is running multiple groups and # this particular banner has not yet been printed. at_fn_banner () { $at_print_banners || return 0 eval at_banner_text=\$at_banner_text_$1 test "x$at_banner_text" = "x " && return 0 eval "at_banner_text_$1=\" \"" if test -z "$at_banner_text"; then $at_first || echo else $as_echo "$as_nl$at_banner_text$as_nl" fi } # at_fn_banner # at_fn_check_prepare_notrace REASON LINE # --------------------------------------- # Perform AT_CHECK preparations for the command at LINE for an untraceable # command; REASON is the reason for disabling tracing. at_fn_check_prepare_notrace () { $at_trace_echo "Not enabling shell tracing (command contains $1)" $as_echo "$2" >"$at_check_line_file" at_check_trace=: at_check_filter=: : >"$at_stdout"; : >"$at_stderr" } # at_fn_check_prepare_trace LINE # ------------------------------ # Perform AT_CHECK preparations for the command at LINE for a traceable # command. at_fn_check_prepare_trace () { $as_echo "$1" >"$at_check_line_file" at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace : >"$at_stdout"; : >"$at_stderr" } # at_fn_check_prepare_dynamic COMMAND LINE # ---------------------------------------- # Decide if COMMAND at LINE is traceable at runtime, and call the appropriate # preparation function. at_fn_check_prepare_dynamic () { case $1 in *$as_nl*) at_fn_check_prepare_notrace 'an embedded newline' "$2" ;; *) at_fn_check_prepare_trace "$2" ;; esac } # at_fn_filter_trace # ------------------ # Remove the lines in the file "$at_stderr" generated by "set -x" and print # them to stderr. at_fn_filter_trace () { mv "$at_stderr" "$at_stder1" grep '^ *+' "$at_stder1" >&2 grep -v '^ *+' "$at_stder1" >"$at_stderr" } # at_fn_log_failure FILE-LIST # --------------------------- # Copy the files in the list on stdout with a "> " prefix, and exit the shell # with a failure exit code. at_fn_log_failure () { for file do $as_echo "$file:"; sed 's/^/> /' "$file"; done echo 1 > "$at_status_file" exit 1 } # at_fn_check_skip EXIT-CODE LINE # ------------------------------- # Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit # the test group subshell with that same exit code. Use LINE in any report # about test failure. at_fn_check_skip () { case $1 in 99) echo 99 > "$at_status_file"; at_failed=: $as_echo "$2: hard failure"; exit 99;; 77) echo 77 > "$at_status_file"; exit 77;; esac } # at_fn_check_status EXPECTED EXIT-CODE LINE # ------------------------------------------ # Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing. # Otherwise, if it is 77 or 99, exit the test group subshell with that same # exit code; if it is anything else print an error message referring to LINE, # and fail the test. at_fn_check_status () { case $2 in $1 ) ;; 77) echo 77 > "$at_status_file"; exit 77;; 99) echo 99 > "$at_status_file"; at_failed=: $as_echo "$3: hard failure"; exit 99;; *) $as_echo "$3: exit code was $2, expected $1" at_failed=:;; esac } # at_fn_diff_devnull FILE # ----------------------- # Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff # invocations. at_fn_diff_devnull () { test -s "$1" || return 0 $at_diff "$at_devnull" "$1" } # at_fn_test NUMBER # ----------------- # Parse out test NUMBER from the tail of this file. at_fn_test () { eval at_sed=\$at_sed$1 sed "$at_sed" "$at_myself" > "$at_test_source" } # at_fn_create_debugging_script # ----------------------------- # Create the debugging script $at_group_dir/run which will reproduce the # current test group. at_fn_create_debugging_script () { { echo "#! /bin/sh" && echo 'test "${ZSH_VERSION+set}" = set && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' && $as_echo "cd '$at_dir'" && $as_echo "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" && echo 'exit 1' } >"$at_group_dir/run" && chmod +x "$at_group_dir/run" } ## -------------------------------- ## ## End of autotest shell functions. ## ## -------------------------------- ## { $as_echo "## ---------------- ## ## Tested programs. ## ## ---------------- ##" echo } >&5 # Report what programs are being tested. for at_program in : $at_tested do test "$at_program" = : && continue case $at_program in [\\/]* | ?:[\\/]* ) $at_program_=$at_program ;; * ) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -f "$as_dir/$at_program" && break done IFS=$as_save_IFS at_program_=$as_dir/$at_program ;; esac if test -f "$at_program_"; then { $as_echo "$at_srcdir/local.at:1471: $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 3.5.4] $as_me: $at_fail_list${at_fail_list:+ failed${at_xpass_list:+, }}$at_xpass_list${at_xpass_list:+ passed unexpectedly} You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below \`${at_testdir+${at_testdir}/}$as_me.dir'. " exit 1 fi exit 0 ## ------------- ## ## Actual tests. ## ## ------------- ## #AT_START_1 at_fn_group_banner 1 'input.at:27' \ "Invalid number of arguments" " " 1 at_xfail=no ( $as_echo "1. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/input.at:32: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret " at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret " "input.at:32" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "bison: missing operand Try 'bison --help' for more information. " | \ $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:32" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:37: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y 2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y 2.y" "input.at:37" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "bison: extra operand '2.y' Try 'bison --help' for more information. " | \ $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:37" $at_failed && at_fn_log_failure $at_traceon; } # For some reason, on some systems we use the system's getopt, not the # one we ship in gnulib. So we can get two different error messages. # See https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00154.html { set +x $as_echo "$at_srcdir/input.at:42: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --skeleton" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --skeleton" "input.at:42" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --skeleton ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:42" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:48: sed -e \\ \"s/requires an argument -- skeleton/'--skeleton' requires an argument/\" \\ stderr" at_fn_check_prepare_notrace 'an embedded newline' "input.at:48" ( $at_check_trace; sed -e \ "s/requires an argument -- skeleton/'--skeleton' requires an argument/" \ 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: option '--skeleton' requires an argument Try 'bison --help' for more information. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.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_1 #AT_START_2 at_fn_group_banner 2 'input.at:58' \ "Invalid options" " " 1 at_xfail=no ( $as_echo "2. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: '0' _ATEOF # We used to accept these, as -f, --report and others were sharing # their code with -W. { set +x $as_echo "$at_srcdir/input.at:67: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -ferror=caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -ferror=caret input.y" "input.at:67" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -ferror=caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:67" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:68: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=error=itemsets input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=error=itemsets input.y" "input.at:68" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=error=itemsets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:68" $at_failed && at_fn_log_failure $at_traceon; } # We used to accept any character after "-Werror", instead of ensuring # this is "=". { set +x $as_echo "$at_srcdir/input.at:72: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror?all input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror?all input.y" "input.at:72" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror?all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at: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:81' \ "Invalid inputs" " " 1 at_xfail=no ( $as_echo "3. $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:93: \"\$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:93" ( $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:93" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:106: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:106" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: invalid characters: '\\0\\001\\002\\377?' input.y:3.1: error: invalid character: '?' input.y:4.14: error: invalid character: '}' input.y:5.1: error: invalid character: '%' input.y:5.2: error: invalid character: '&' input.y:6.1-17: error: invalid directive: '%a-does-not-exist' input.y:7.1: error: invalid character: '%' input.y:7.2: error: invalid character: '-' input.y:8.1-9.0: error: missing '%}' at end of file input.y:8.1-9.0: error: syntax error, unexpected %{...%} " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:106" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:111' \ "Invalid inputs with {}" " " 1 at_xfail=no ( $as_echo "4. $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:128: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:128" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-15: error: syntax error, unexpected %initial-action, expecting {...} " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at: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_4 #AT_START_5 at_fn_group_banner 5 'input.at:137' \ "Yacc warnings on symbols" " " 1 at_xfail=no ( $as_echo "5. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %nterm exp %token NUM 0x40 "number" %% exp: "number"; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -Wyacc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -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:159" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" "input.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -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:159" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:159: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:159" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:159" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:159: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:159" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:159" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:159: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wyacc input.y" at_fn_check_prepare_trace "input.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wyacc 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-6: warning: POSIX Yacc does not support %nterm [-Wyacc] 1 | %nterm exp | ^~~~~~ input.y:2.12-15: warning: POSIX Yacc does not support hexadecimal literals [-Wyacc] 2 | %token NUM 0x40 \"number\" | ^~~~ input.y:2.17-24: warning: POSIX Yacc does not support string literals [-Wyacc] 2 | %token NUM 0x40 \"number\" | ^~~~~~~~ input.y:4.6-13: warning: POSIX Yacc does not support string literals [-Wyacc] 4 | exp: \"number\"; | ^~~~~~~~ " | \ $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:159" $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:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" "input.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -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:159" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:1.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc] 1 | %nterm exp | ^~~~~~ input.y:2.12-15: warning: POSIX Yacc does not support hexadecimal literals [-Wyacc] 2 | %token NUM 0x40 "number" | ^~~~ input.y:2.17-24: warning: POSIX Yacc does not support string literals [-Wyacc] 2 | %token NUM 0x40 "number" | ^~~~~~~~ input.y:4.6-13: warning: POSIX Yacc does not support string literals [-Wyacc] 4 | exp: "number"; | ^~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:159: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:159" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:159" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" "input.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -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:159" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" "input.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:159" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" "input.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:159" $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:168' \ "Yacc warnings" " " 1 at_xfail=no ( $as_echo "6. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %destructor {} %printer {} %type exp a b %% exp: a b { $$ = $1 + $2; }; a: { $$ = 42; } { $$ = $1; }; b: %empty { $$ = 42; }; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:193: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -Wyacc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:193" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -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:193" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:193: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" "input.at:193" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -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:193" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:193: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:193" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:193" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:193: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:193" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:193" $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:193: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wyacc input.y" at_fn_check_prepare_trace "input.at:193" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wyacc 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-11: warning: POSIX Yacc does not support %destructor [-Wyacc] 1 | %destructor {} | ^~~~~~~~~~~ input.y:2.1-8: warning: POSIX Yacc does not support %printer [-Wyacc] 2 | %printer {} | ^~~~~~~~ input.y:6.9-20: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] 6 | a: { \$\$ = 42; } { \$\$ = \$1; }; | ^~~~~~~~~~~~ input.y:7.4-9: warning: POSIX Yacc does not support %empty [-Wyacc] 7 | b: %empty { \$\$ = 42; }; | ^~~~~~ " | \ $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:193" $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:193: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" "input.at:193" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -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:193" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:1.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] 1 | %destructor {} | ^~~~~~~~~~~ input.y:2.1-8: warning: POSIX Yacc does not support %printer [-Wyacc] 2 | %printer {} | ^~~~~~~~ input.y:6.9-20: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] 6 | a: { $$ = 42; } { $$ = $1; }; | ^~~~~~~~~~~~ input.y:7.4-9: warning: POSIX Yacc does not support %empty [-Wyacc] 7 | b: %empty { $$ = 42; }; | ^~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:193: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:193" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:193" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:193: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" "input.at:193" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -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:193" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:193: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" "input.at:193" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:193" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:193: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" "input.at:193" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:193" $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:202' \ "Yacc's %type" " " 1 at_xfail=no ( $as_echo "7. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token TOKEN1 %nterm nterm1 %type TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+' %token TOKEN2 %nterm nterm2 %% expr: nterm1 nterm2 nterm3 nterm1: TOKEN1 nterm2: TOKEN2 nterm3: "TOKEN3" _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:242: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -Wyacc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:242" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -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:242" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:242: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" "input.at:242" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -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:242" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:242: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:242" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:242" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:242: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:242" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:242" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:242: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wyacc input.y" at_fn_check_prepare_trace "input.at:242" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wyacc 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-6: warning: POSIX Yacc does not support %nterm [-Wyacc] 2 | %nterm nterm1 | ^~~~~~ input.y:3.14-19: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 3 | %type TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+' | ^~~~~~ input.y:3.28-35: warning: POSIX Yacc does not support string literals [-Wyacc] 3 | %type TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+' | ^~~~~~~~ input.y:3.28-35: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 3 | %type TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+' | ^~~~~~~~ input.y:3.58-60: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 3 | %type TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+' | ^~~ input.y:5.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc] 5 | %nterm nterm2 | ^~~~~~ input.y:3.21-26: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 3 | %type TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+' | ^~~~~~ input.y:10.9-16: warning: POSIX Yacc does not support string literals [-Wyacc] 10 | nterm3: \"TOKEN3\" | ^~~~~~~~ " | \ $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:242" $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:242: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" "input.at:242" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -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:242" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc] 2 | %nterm nterm1 | ^~~~~~ input.y:3.14-19: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 3 | %type TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+' | ^~~~~~ input.y:3.28-35: warning: POSIX Yacc does not support string literals [-Wyacc] 3 | %type TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+' | ^~~~~~~~ input.y:3.28-35: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 3 | %type TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+' | ^~~~~~~~ input.y:3.58-60: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 3 | %type TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+' | ^~~ input.y:5.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc] 5 | %nterm nterm2 | ^~~~~~ input.y:3.21-26: warning: POSIX yacc reserves %type to nonterminals [-Wyacc] 3 | %type TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+' | ^~~~~~ input.y:10.9-16: warning: POSIX Yacc does not support string literals [-Wyacc] 10 | nterm3: "TOKEN3" | ^~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:242: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:242" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:242" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:242: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" "input.at:242" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -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:242" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:242: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" "input.at:242" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:242" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:242: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" "input.at:242" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:242" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_7 #AT_START_8 at_fn_group_banner 8 'input.at:251' \ "Invalid symbol declarations" " " 1 at_xfail=no ( $as_echo "8. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %nterm expr "expression"; %nterm term 123; %nterm fact 124 "factor"; %nterm '+' '*'; %nterm "number"; %token "tok1" 1; %left "tok2" 2; %type "tok3" 3; %% expr: expr '+' term | term; term: term '*' fact | fact; fact: "number"; _ATEOF { set +x $as_echo "$at_srcdir/input.at:296: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:296" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.13-24: error: nonterminals cannot be given a string alias 1 | %nterm expr \"expression\"; | ^~~~~~~~~~~~ input.y:2.13-15: error: nonterminals cannot be given an explicit number 2 | %nterm term 123; | ^~~ input.y:3.13-15: error: nonterminals cannot be given an explicit number 3 | %nterm fact 124 \"factor\"; | ^~~ input.y:3.17-24: error: nonterminals cannot be given a string alias 3 | %nterm fact 124 \"factor\"; | ^~~~~~~~ input.y:4.8-10: error: character literals cannot be nonterminals 4 | %nterm '+' '*'; | ^~~ input.y:5.8-15: error: syntax error, unexpected string, expecting character literal or identifier or 5 | %nterm \"number\"; | ^~~~~~~~ input.y:6.8-13: error: syntax error, unexpected string, expecting character literal or identifier or 6 | %token \"tok1\" 1; | ^~~~~~ input.y:7.14: error: syntax error, unexpected integer 7 | %left \"tok2\" 2; | ^ input.y:8.14: error: syntax error, unexpected integer 8 | %type \"tok3\" 3; | ^ " | \ $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:296" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:305' \ "Redefining the error token" " " 1 at_xfail=no ( $as_echo "9. $at_setup_line: testing $at_desc ..." $at_traceon # We used to crash when trying to display the original definition of # "error", which is a builtin without any location. cat >input.y <<'_ATEOF' %token error 123 %token error 124 %% exp: _ATEOF { set +x $as_echo "$at_srcdir/input.at:327: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:327" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.8-12: warning: symbol error redeclared [-Wother] 2 | %token error 124 | ^~~~~ input.y:1.8-12: previous declaration 1 | %token error 123 | ^~~~~ input.y:2.14-16: error: redefining user token number of error 2 | %token error 124 | ^~~ " | \ $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:327" $at_failed && at_fn_log_failure $at_traceon; } # While at it, make sure we properly used the user's number for # "error". cat >input.y <<'_ATEOF' %token error 123 %% 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/input.at:337: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:337" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:337" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:337: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:337" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:337" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:337: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:337" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:337" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:337: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:337" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:337" $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:337: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:337" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:337" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:342: \$EGREP -E '123|256' input.tab.c" at_fn_check_prepare_notrace 'a shell pipeline' "input.at:342" ( $at_check_trace; $EGREP -E '123|256' 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 " 0, 123, 257 #define YYERRCODE 123 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:342" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_9 #AT_START_10 at_fn_group_banner 10 'input.at:351' \ "Dangling aliases" " " 1 at_xfail=no ( $as_echo "10. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token FOO "foo" %type "bar" %% expr: "foo" "bar" "baz" _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -Wdangling input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -Wdangling input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wdangling input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wdangling input.y" "input.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wdangling input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:367" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:367: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:367" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:367" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:367: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:367" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/input.at:367: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wdangling input.y" at_fn_check_prepare_trace "input.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wdangling 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-17: warning: string literal \"bar\" not attached to a symbol [-Wdangling-alias] 2 | %type \"bar\" | ^~~~~ input.y:4.19-23: warning: string literal \"baz\" not attached to a symbol [-Wdangling-alias] 4 | expr: \"foo\" \"bar\" \"baz\" | ^~~~~ " | \ $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:367" $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:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Werror" "input.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling 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:367" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.13-17: warning: string literal "bar" not attached to a symbol [-Wdangling-alias] 2 | %type "bar" | ^~~~~ input.y:4.19-23: warning: string literal "baz" not attached to a symbol [-Wdangling-alias] 4 | expr: "foo" "bar" "baz" | ^~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:367: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:367" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:367" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=error" "input.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling 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:367" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Wnone,none -Werror --trace=none" "input.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=none -Werror --trace=none" "input.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:367" $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:377' \ "Symbol declarations" " " 1 at_xfail=no ( $as_echo "11. $at_setup_line: testing $at_desc ..." $at_traceon cat >dump-symbols.m4 <<'_ATEOF' m4_define([b4_symbol_dump], [$1, dnl b4_symbol_if([$1], [is_token], [Token], [Nonterminal]), dnl b4_symbol([$1], [tag]), dnl b4_symbol([$1], [id]), dnl b4_symbol([$1], [user_number]), dnl b4_symbol([$1], [type]), ]) b4_output_begin([symbols.csv]) number, class, tag, id, user_number, type, b4_symbol_foreach([b4_symbol_dump])dnl b4_output_end _ATEOF cat >input.y <<'_ATEOF' %token 'a' A1 1 "A1" A2 A3 "A3" A4 4 'b' B5 5 "B5" B6 B7 "B8" B9 9 'c' C10 10 "C10" C11 C12 "C12" C13 13 %left 'd' D20 20 "D20" D21 D22 "D22" D23 23 'e' E25 25 "E25" E26 E27 "E28" E29 29 'f' F30 30 "F30" F31 F32 "F32" F33 33 %type 'g' G40 "D40" G21 G22 G23 'h' H25 "H25" H26 H27 "H28" H29 'i' I30 "I30" I31 I32 "I32" I33 %nterm j60 j61 j62 j63 k75 k76 k77 k79 l80 l81 l82 l83 %% 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/input.at:415: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-other -S./dump-symbols.m4 input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:415" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-other -S./dump-symbols.m4 input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:415" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:415: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S./dump-symbols.m4 input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S./dump-symbols.m4 input.y" "input.at:415" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S./dump-symbols.m4 input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:415" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:415: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:415" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:415" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:415: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:415" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/input.at:415: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-other -S./dump-symbols.m4 input.y" at_fn_check_prepare_trace "input.at:415" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-other -S./dump-symbols.m4 input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:415" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:467: cat symbols.csv" at_fn_check_prepare_trace "input.at:467" ( $at_check_trace; cat symbols.csv ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "number, class, tag, id, user_number, type, 0, Token, \$end, , 0, , 1, Nonterminal, error, error, 256, , 2, Nonterminal, \$undefined, , 257, , 3, Token, 'a', , 97, , 4, Token, \"A1\", A1, 1, , 5, Token, A2, A2, 258, , 6, Token, \"A3\", A3, 259, , 7, Token, A4, A4, 4, , 8, Token, 'b', , 98, type_b, 9, Token, \"B5\", B5, 5, type_b, 10, Token, B6, B6, 260, type_b, 11, Token, \"B8\", B7, 261, type_b, 12, Token, B9, B9, 9, type_b, 13, Token, 'c', , 99, type_c, 14, Token, \"C10\", C10, 10, type_c, 15, Token, C11, C11, 262, type_c, 16, Token, \"C12\", C12, 263, type_c, 17, Token, C13, C13, 13, type_c, 18, Token, 'd', , 100, , 19, Token, D20, D20, 20, , 20, Token, \"D20\", , 264, , 21, Token, D21, D21, 265, , 22, Token, D22, D22, 266, , 23, Token, \"D22\", , 267, , 24, Token, D23, D23, 23, , 25, Token, 'e', , 101, type_e, 26, Token, E25, E25, 25, type_e, 27, Token, \"E25\", , 268, type_e, 28, Token, E26, E26, 269, type_e, 29, Token, E27, E27, 270, type_e, 30, Token, \"E28\", , 271, type_e, 31, Token, E29, E29, 29, type_e, 32, Token, 'f', , 102, type_f, 33, Token, F30, F30, 30, type_f, 34, Token, \"F30\", , 272, type_f, 35, Token, F31, F31, 273, type_f, 36, Token, F32, F32, 274, type_f, 37, Token, \"F32\", , 275, type_f, 38, Token, F33, F33, 33, type_f, 39, Token, 'g', , 103, , 40, Token, \"D40\", , 276, , 41, Token, 'h', , 104, type_h, 42, Token, \"H25\", , 277, type_h, 43, Token, \"H28\", , 278, type_h, 44, Token, 'i', , 105, type_i, 45, Token, \"I30\", , 279, type_i, 46, Token, \"I32\", , 280, type_i, 47, Nonterminal, \$accept, , -1, , 48, Nonterminal, exp, exp, -1, , " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.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_11 #AT_START_12 at_fn_group_banner 12 'input.at:476' \ "Invalid \$n and @n" " " 1 at_xfail=no ( $as_echo "12. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: %empty { $$ = $1 ; }; exp: %empty { @$ = @1 ; }; _ATEOF { set +x $as_echo "$at_srcdir/input.at:491: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:491" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.20-21: error: integer out of range: '\$1' 2 | exp: %empty { \$\$ = \$1 ; }; | ^~ input.y:3.20-21: error: integer out of range: '@1' 3 | exp: %empty { @\$ = @1 ; }; | ^~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:491" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:500' \ "Type Clashes" " " 1 at_xfail=no ( $as_echo "13. $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:529: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:529" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:5.12-13: error: \$\$ for the midrule at \$2 of 'exp' has no declared type 5 | exp: foo { \$\$; } foo { \$2; } foo | ^~ input.y:5.24-25: error: \$2 of 'exp' has no declared type 5 | exp: foo { \$\$; } foo { \$2; } foo | ^~ input.y:5.6-32: warning: type clash on default action: != <> [-Wother] 5 | exp: foo { \$\$; } foo { \$2; } foo | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:6.6-8: warning: type clash on default action: != <> [-Wother] 6 | | foo | ^~~ input.y:7.6-11: warning: empty rule for typed nonterminal, and no action [-Wother] 7 | | %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:529" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:722' \ "Unused values" " " 1 at_xfail=no ( $as_echo "14. $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 m n o; %destructor { destroy ($$); } ; %% 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; } | 'm' m { $2; } | 'n' n { $2; } | 'o' o { $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; }; m: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; }; n: INT | INT { } INT { } INT { }; o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $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:723: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:723" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:723" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:723: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:723" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:723" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:723: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:723" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:723" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:723: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:723" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:723" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:723: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "input.at:723" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:12.10-32: warning: unset value: \$\$ [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~ input.y:12.10-12: warning: unused value: \$1 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.18-20: warning: unused value: \$3 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.26-28: warning: unused value: \$5 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] 13 | b: INT | %empty; | ^~~~~~ input.y:14.10-62: warning: unset value: \$\$ [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:14.22-24: warning: unused value: \$3 [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~ input.y:14.43-45: warning: unused value: \$5 [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~ input.y:15.10-49: warning: unset value: \$\$ [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:15.18-20: warning: unused value: \$3 [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:15.30-32: warning: unused value: \$5 [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:16.10-37: warning: unset value: \$\$ [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:16.18-20: warning: unused value: \$3 [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~ input.y:16.27-29: warning: unused value: \$5 [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~ input.y:18.10-58: warning: unset value: \$\$ [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:18.10-12: warning: unused value: \$1 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:18.31-33: warning: unused value: \$3 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:18.52-54: warning: unused value: \$5 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:19.10-72: warning: unset value: \$\$ [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.10-12: warning: unused value: \$1 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:19.31-33: warning: unused value: \$3 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:19.66-68: warning: unused value: \$5 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:22.10-68: warning: unset value: \$\$ [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:22.10-12: warning: unused value: \$1 [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~ input.y:22.14-16: warning: unused value: \$2 [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~ input.y:25.23-25: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.10-50: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.10-12: warning: unused value: \$1 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.23-25: warning: unused value: \$2 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.27-29: warning: unused value: \$3 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unused value: \$4 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.44-46: warning: unused value: \$5 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:26.23-25: warning: unset value: \$\$ [-Wother] 26 | o: INT | INT { } INT { } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; }; | ^~~ input.y:26.40-42: warning: unset value: \$\$ [-Wother] 26 | o: INT | INT { } INT { } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; }; | ^~~ " | \ $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:723" $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:723: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:723" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:723" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:12.10-32: warning: unset value: $$ [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~ input.y:12.10-12: warning: unused value: $1 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.18-20: warning: unused value: $3 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.26-28: warning: unused value: $5 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] 13 | b: INT | %empty; | ^~~~~~ input.y:14.10-62: warning: unset value: $$ [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:14.22-24: warning: unused value: $3 [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~ input.y:14.43-45: warning: unused value: $5 [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~ input.y:15.10-49: warning: unset value: $$ [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:15.18-20: warning: unused value: $3 [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:15.30-32: warning: unused value: $5 [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:16.10-37: warning: unset value: $$ [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:16.18-20: warning: unused value: $3 [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~ input.y:16.27-29: warning: unused value: $5 [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~ input.y:18.10-58: warning: unset value: $$ [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:18.10-12: warning: unused value: $1 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:18.31-33: warning: unused value: $3 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:18.52-54: warning: unused value: $5 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:19.10-72: warning: unset value: $$ [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.10-12: warning: unused value: $1 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:19.31-33: warning: unused value: $3 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:19.66-68: warning: unused value: $5 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:22.10-68: warning: unset value: $$ [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:22.10-12: warning: unused value: $1 [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~ input.y:22.14-16: warning: unused value: $2 [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~ input.y:25.23-25: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.10-50: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.10-12: warning: unused value: $1 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.23-25: warning: unused value: $2 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.27-29: warning: unused value: $3 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unused value: $4 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.44-46: warning: unused value: $5 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:26.23-25: warning: unset value: $$ [-Wother] 26 | o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; | ^~~ input.y:26.40-42: warning: unset value: $$ [-Wother] 26 | o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; | ^~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:723: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:723" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:723" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:723: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:723" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:723" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:723: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:723" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:723" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:723: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:723" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:723" $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 m n o; %destructor { destroy ($$); } ; %% 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; } | 'm' m { $2; } | 'n' n { $2; } | 'o' o { $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; }; m: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; }; n: INT | INT { } INT { } INT { }; o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $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:724: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:724" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:724" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:724: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:724" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:724" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:724: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:724" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:724" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:724: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:724" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:724" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:724: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_trace "input.at:724" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:12.10-32: warning: unset value: \$\$ [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~ input.y:12.10-12: warning: unused value: \$1 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.18-20: warning: unused value: \$3 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.26-28: warning: unused value: \$5 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] 13 | b: INT | %empty; | ^~~~~~ input.y:14.14-20: warning: unset value: \$\$ [-Wmidrule-values] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~~~~~ input.y:14.26-41: warning: unset value: \$\$ [-Wmidrule-values] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~~~~~~~~~~~~~~ input.y:14.10-62: warning: unset value: \$\$ [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:14.22-24: warning: unused value: \$3 [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~ input.y:14.43-45: warning: unused value: \$5 [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~ input.y:15.14-16: warning: unset value: \$\$ [-Wmidrule-values] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:15.10-49: warning: unset value: \$\$ [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:15.18-20: warning: unused value: \$3 [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:15.30-32: warning: unused value: \$5 [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:16.10-37: warning: unset value: \$\$ [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:16.18-20: warning: unused value: \$3 [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~ input.y:16.27-29: warning: unused value: \$5 [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~ input.y:18.10-58: warning: unset value: \$\$ [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:18.10-12: warning: unused value: \$1 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:18.14-29: warning: unused value: \$2 [-Wmidrule-values] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~~~~~~~~~~~~~~ input.y:18.31-33: warning: unused value: \$3 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:18.35-50: warning: unused value: \$4 [-Wmidrule-values] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~~~~~~~~~~~~~~ input.y:18.52-54: warning: unused value: \$5 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:19.10-72: warning: unset value: \$\$ [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.10-12: warning: unused value: \$1 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:19.31-33: warning: unused value: \$3 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:19.35-64: warning: unused value: \$4 [-Wmidrule-values] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.66-68: warning: unused value: \$5 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:21.18-37: warning: unused value: \$3 [-Wmidrule-values] 21 | j: INT | INT INT { \$\$ = 1; } { \$\$ = \$1 + \$2; }; | ^~~~~~~~~~~~~~~~~~~~ input.y:22.10-68: warning: unset value: \$\$ [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:22.10-12: warning: unused value: \$1 [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~ input.y:22.14-16: warning: unused value: \$2 [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~ input.y:22.35-64: warning: unused value: \$4 [-Wmidrule-values] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.23-25: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.10-50: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.10-12: warning: unused value: \$1 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.23-25: warning: unused value: \$2 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.27-29: warning: unused value: \$3 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unused value: \$4 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.44-46: warning: unused value: \$5 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:26.23-25: warning: unset value: \$\$ [-Wother] 26 | o: INT | INT { } INT { } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; }; | ^~~ input.y:26.40-42: warning: unset value: \$\$ [-Wother] 26 | o: INT | INT { } INT { } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; }; | ^~~ " | \ $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:724" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:724: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror" "input.at:724" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:724" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:12.10-32: warning: unset value: $$ [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~ input.y:12.10-12: warning: unused value: $1 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.18-20: warning: unused value: $3 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.26-28: warning: unused value: $5 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] 13 | b: INT | %empty; | ^~~~~~ input.y:14.14-20: warning: unset value: $$ [-Wmidrule-values] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~~~~~ input.y:14.26-41: warning: unset value: $$ [-Wmidrule-values] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~~~~~~~~~~~~~~ input.y:14.10-62: warning: unset value: $$ [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:14.22-24: warning: unused value: $3 [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~ input.y:14.43-45: warning: unused value: $5 [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~ input.y:15.14-16: warning: unset value: $$ [-Wmidrule-values] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:15.10-49: warning: unset value: $$ [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:15.18-20: warning: unused value: $3 [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:15.30-32: warning: unused value: $5 [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:16.10-37: warning: unset value: $$ [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:16.18-20: warning: unused value: $3 [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~ input.y:16.27-29: warning: unused value: $5 [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~ input.y:18.10-58: warning: unset value: $$ [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:18.10-12: warning: unused value: $1 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:18.14-29: warning: unused value: $2 [-Wmidrule-values] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~~~~~~~~~~~~~~ input.y:18.31-33: warning: unused value: $3 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:18.35-50: warning: unused value: $4 [-Wmidrule-values] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~~~~~~~~~~~~~~ input.y:18.52-54: warning: unused value: $5 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:19.10-72: warning: unset value: $$ [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.10-12: warning: unused value: $1 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:19.31-33: warning: unused value: $3 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:19.35-64: warning: unused value: $4 [-Wmidrule-values] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.66-68: warning: unused value: $5 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:21.18-37: warning: unused value: $3 [-Wmidrule-values] 21 | j: INT | INT INT { $$ = 1; } { $$ = $1 + $2; }; | ^~~~~~~~~~~~~~~~~~~~ input.y:22.10-68: warning: unset value: $$ [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:22.10-12: warning: unused value: $1 [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~ input.y:22.14-16: warning: unused value: $2 [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~ input.y:22.35-64: warning: unused value: $4 [-Wmidrule-values] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.23-25: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.10-50: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.10-12: warning: unused value: $1 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.23-25: warning: unused value: $2 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.27-29: warning: unused value: $3 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unused value: $4 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.44-46: warning: unused value: $5 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:26.23-25: warning: unset value: $$ [-Wother] 26 | o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; | ^~~ input.y:26.40-42: warning: unset value: $$ [-Wother] 26 | o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; | ^~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:724: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:724" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:724" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:724: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:724" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:724" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:724: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:724" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:724" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:724: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none" "input.at:724" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:724" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_14 #AT_START_15 at_fn_group_banner 15 'input.at:732' \ "Unused values before symbol declarations" " " 1 at_xfail=no ( $as_echo "15. $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; } | 'm' m { $2; } | 'n' n { $2; } | 'o' o { $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; }; m: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; }; n: INT | INT { } INT { } INT { }; o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; %token INT; %type a b c d e f g h i j k l m n o; %destructor { destroy ($$); } ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:733" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:733" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:733: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:733" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:733" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:733: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:733" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/input.at:733: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "input.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:12.10-32: warning: unset value: \$\$ [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~ input.y:12.10-12: warning: unused value: \$1 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.18-20: warning: unused value: \$3 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.26-28: warning: unused value: \$5 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] 13 | b: INT | %empty; | ^~~~~~ input.y:14.10-62: warning: unset value: \$\$ [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:14.22-24: warning: unused value: \$3 [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~ input.y:14.43-45: warning: unused value: \$5 [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~ input.y:15.10-49: warning: unset value: \$\$ [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:15.18-20: warning: unused value: \$3 [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:15.30-32: warning: unused value: \$5 [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:16.10-37: warning: unset value: \$\$ [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:16.18-20: warning: unused value: \$3 [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~ input.y:16.27-29: warning: unused value: \$5 [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~ input.y:18.10-58: warning: unset value: \$\$ [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:18.10-12: warning: unused value: \$1 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:18.31-33: warning: unused value: \$3 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:18.52-54: warning: unused value: \$5 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:19.10-72: warning: unset value: \$\$ [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.10-12: warning: unused value: \$1 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:19.31-33: warning: unused value: \$3 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:19.66-68: warning: unused value: \$5 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:22.10-68: warning: unset value: \$\$ [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:22.10-12: warning: unused value: \$1 [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~ input.y:22.14-16: warning: unused value: \$2 [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~ input.y:25.23-25: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.10-50: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.10-12: warning: unused value: \$1 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.23-25: warning: unused value: \$2 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.27-29: warning: unused value: \$3 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unused value: \$4 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.44-46: warning: unused value: \$5 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:26.23-25: warning: unset value: \$\$ [-Wother] 26 | o: INT | INT { } INT { } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; }; | ^~~ input.y:26.40-42: warning: unset value: \$\$ [-Wother] 26 | o: INT | INT { } INT { } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; }; | ^~~ " | \ $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:733" $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:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:733" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:12.10-32: warning: unset value: $$ [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~ input.y:12.10-12: warning: unused value: $1 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.18-20: warning: unused value: $3 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.26-28: warning: unused value: $5 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] 13 | b: INT | %empty; | ^~~~~~ input.y:14.10-62: warning: unset value: $$ [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:14.22-24: warning: unused value: $3 [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~ input.y:14.43-45: warning: unused value: $5 [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~ input.y:15.10-49: warning: unset value: $$ [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:15.18-20: warning: unused value: $3 [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:15.30-32: warning: unused value: $5 [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:16.10-37: warning: unset value: $$ [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:16.18-20: warning: unused value: $3 [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~ input.y:16.27-29: warning: unused value: $5 [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~ input.y:18.10-58: warning: unset value: $$ [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:18.10-12: warning: unused value: $1 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:18.31-33: warning: unused value: $3 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:18.52-54: warning: unused value: $5 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:19.10-72: warning: unset value: $$ [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.10-12: warning: unused value: $1 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:19.31-33: warning: unused value: $3 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:19.66-68: warning: unused value: $5 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:22.10-68: warning: unset value: $$ [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:22.10-12: warning: unused value: $1 [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~ input.y:22.14-16: warning: unused value: $2 [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~ input.y:25.23-25: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.10-50: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.10-12: warning: unused value: $1 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.23-25: warning: unused value: $2 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.27-29: warning: unused value: $3 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unused value: $4 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.44-46: warning: unused value: $5 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:26.23-25: warning: unset value: $$ [-Wother] 26 | o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; | ^~~ input.y:26.40-42: warning: unset value: $$ [-Wother] 26 | o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; | ^~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:733: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:733" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:733" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:733" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:733" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:733" $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; } | 'm' m { $2; } | 'n' n { $2; } | 'o' o { $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; }; m: INT | INT { $$ = $1; } INT { $$ = $2 + $3; } INT { $$ = $4 + $5; }; n: INT | INT { } INT { } INT { }; o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; %token INT; %type a b c d e f g h i j k l m n o; %destructor { destroy ($$); } ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:734" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:734" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/input.at:734: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y" at_fn_check_prepare_trace "input.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:12.10-32: warning: unset value: \$\$ [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~ input.y:12.10-12: warning: unused value: \$1 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.18-20: warning: unused value: \$3 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.26-28: warning: unused value: \$5 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] 13 | b: INT | %empty; | ^~~~~~ input.y:14.14-20: warning: unset value: \$\$ [-Wmidrule-values] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~~~~~ input.y:14.26-41: warning: unset value: \$\$ [-Wmidrule-values] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~~~~~~~~~~~~~~ input.y:14.10-62: warning: unset value: \$\$ [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:14.22-24: warning: unused value: \$3 [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~ input.y:14.43-45: warning: unused value: \$5 [-Wother] 14 | c: INT | INT { \$1; } INT { \$2; } INT { \$4; }; | ^~~ input.y:15.14-16: warning: unset value: \$\$ [-Wmidrule-values] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:15.10-49: warning: unset value: \$\$ [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:15.18-20: warning: unused value: \$3 [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:15.30-32: warning: unused value: \$5 [-Wother] 15 | d: INT | INT { } INT { \$1; } INT { \$2; }; | ^~~ input.y:16.10-37: warning: unset value: \$\$ [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:16.18-20: warning: unused value: \$3 [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~ input.y:16.27-29: warning: unused value: \$5 [-Wother] 16 | e: INT | INT { } INT { } INT { \$1; }; | ^~~ input.y:18.10-58: warning: unset value: \$\$ [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:18.10-12: warning: unused value: \$1 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:18.14-29: warning: unused value: \$2 [-Wmidrule-values] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~~~~~~~~~~~~~~ input.y:18.31-33: warning: unused value: \$3 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:18.35-50: warning: unused value: \$4 [-Wmidrule-values] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~~~~~~~~~~~~~~ input.y:18.52-54: warning: unused value: \$5 [-Wother] 18 | g: INT | INT { \$\$; } INT { \$\$; } INT { }; | ^~~ input.y:19.10-72: warning: unset value: \$\$ [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.10-12: warning: unused value: \$1 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:19.31-33: warning: unused value: \$3 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:19.35-64: warning: unused value: \$4 [-Wmidrule-values] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.66-68: warning: unused value: \$5 [-Wother] 19 | h: INT | INT { \$\$; } INT { \$\$ = \$2; } INT { }; | ^~~ input.y:21.18-37: warning: unused value: \$3 [-Wmidrule-values] 21 | j: INT | INT INT { \$\$ = 1; } { \$\$ = \$1 + \$2; }; | ^~~~~~~~~~~~~~~~~~~~ input.y:22.10-68: warning: unset value: \$\$ [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:22.10-12: warning: unused value: \$1 [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~ input.y:22.14-16: warning: unused value: \$2 [-Wother] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~ input.y:22.35-64: warning: unused value: \$4 [-Wmidrule-values] 22 | k: INT | INT INT { \$\$; } { \$\$ = \$3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.23-25: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.10-50: warning: unset value: \$\$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.10-12: warning: unused value: \$1 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.23-25: warning: unused value: \$2 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.27-29: warning: unused value: \$3 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unused value: \$4 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.44-46: warning: unused value: \$5 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:26.23-25: warning: unset value: \$\$ [-Wother] 26 | o: INT | INT { } INT { } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; }; | ^~~ input.y:26.40-42: warning: unset value: \$\$ [-Wother] 26 | o: INT | INT { } INT { } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; }; | ^~~ " | \ $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:734" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/input.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror" "input.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:734" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:12.10-32: warning: unset value: $$ [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~ input.y:12.10-12: warning: unused value: $1 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.18-20: warning: unused value: $3 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:12.26-28: warning: unused value: $5 [-Wother] 12 | a: INT | INT { } INT { } INT { }; | ^~~ input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother] 13 | b: INT | %empty; | ^~~~~~ input.y:14.14-20: warning: unset value: $$ [-Wmidrule-values] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~~~~~ input.y:14.26-41: warning: unset value: $$ [-Wmidrule-values] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~~~~~~~~~~~~~~ input.y:14.10-62: warning: unset value: $$ [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:14.22-24: warning: unused value: $3 [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~ input.y:14.43-45: warning: unused value: $5 [-Wother] 14 | c: INT | INT { $1; } INT { $2; } INT { $4; }; | ^~~ input.y:15.14-16: warning: unset value: $$ [-Wmidrule-values] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:15.10-49: warning: unset value: $$ [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:15.18-20: warning: unused value: $3 [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:15.30-32: warning: unused value: $5 [-Wother] 15 | d: INT | INT { } INT { $1; } INT { $2; }; | ^~~ input.y:16.10-37: warning: unset value: $$ [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:16.18-20: warning: unused value: $3 [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~ input.y:16.27-29: warning: unused value: $5 [-Wother] 16 | e: INT | INT { } INT { } INT { $1; }; | ^~~ input.y:18.10-58: warning: unset value: $$ [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:18.10-12: warning: unused value: $1 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:18.14-29: warning: unused value: $2 [-Wmidrule-values] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~~~~~~~~~~~~~~ input.y:18.31-33: warning: unused value: $3 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:18.35-50: warning: unused value: $4 [-Wmidrule-values] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~~~~~~~~~~~~~~ input.y:18.52-54: warning: unused value: $5 [-Wother] 18 | g: INT | INT { $$; } INT { $$; } INT { }; | ^~~ input.y:19.10-72: warning: unset value: $$ [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.10-12: warning: unused value: $1 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:19.31-33: warning: unused value: $3 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:19.35-64: warning: unused value: $4 [-Wmidrule-values] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:19.66-68: warning: unused value: $5 [-Wother] 19 | h: INT | INT { $$; } INT { $$ = $2; } INT { }; | ^~~ input.y:21.18-37: warning: unused value: $3 [-Wmidrule-values] 21 | j: INT | INT INT { $$ = 1; } { $$ = $1 + $2; }; | ^~~~~~~~~~~~~~~~~~~~ input.y:22.10-68: warning: unset value: $$ [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:22.10-12: warning: unused value: $1 [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~ input.y:22.14-16: warning: unused value: $2 [-Wother] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~ input.y:22.35-64: warning: unused value: $4 [-Wmidrule-values] 22 | k: INT | INT INT { $$; } { $$ = $3; } { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.23-25: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.10-50: warning: unset value: $$ [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:25.10-12: warning: unused value: $1 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.23-25: warning: unused value: $2 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.27-29: warning: unused value: $3 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.40-42: warning: unused value: $4 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:25.44-46: warning: unused value: $5 [-Wother] 25 | n: INT | INT { } INT { } INT { }; | ^~~ input.y:26.23-25: warning: unset value: $$ [-Wother] 26 | o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; | ^~~ input.y:26.40-42: warning: unset value: $$ [-Wother] 26 | o: INT | INT { } INT { } INT { $$ = $1 + $2 + $3 + $4 + $5; }; | ^~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:734: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:734" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:734" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:734" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none" "input.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:734" $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_15 #AT_START_16 at_fn_group_banner 16 'input.at:742' \ "Symbol redeclared" " " 1 at_xfail=no ( $as_echo "16. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token FOO FOO %token BAR 12 BAR 12 %token EOF 0 EOF 0 %% exp: 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/input.at:771: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:771" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:771" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:771: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:771" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:771" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:771: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:771" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:771" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:771: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:771" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:771" $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:771: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "input.at:771" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.12-14: warning: symbol FOO redeclared [-Wother] 1 | %token FOO FOO | ^~~ input.y:1.8-10: previous declaration 1 | %token FOO FOO | ^~~ input.y:2.15-17: warning: symbol BAR redeclared [-Wother] 2 | %token BAR 12 BAR 12 | ^~~ input.y:2.8-10: previous declaration 2 | %token BAR 12 BAR 12 | ^~~ input.y:3.14-16: warning: symbol EOF redeclared [-Wother] 3 | %token EOF 0 EOF 0 | ^~~ input.y:3.8-10: previous declaration 3 | %token EOF 0 EOF 0 | ^~~ " | \ $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:771" $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:771: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:771" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:771" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:1.12-14: warning: symbol FOO redeclared [-Wother] 1 | %token FOO FOO | ^~~ input.y:1.8-10: previous declaration 1 | %token FOO FOO | ^~~ input.y:2.15-17: warning: symbol BAR redeclared [-Wother] 2 | %token BAR 12 BAR 12 | ^~~ input.y:2.8-10: previous declaration 2 | %token BAR 12 BAR 12 | ^~~ input.y:3.14-16: warning: symbol EOF redeclared [-Wother] 3 | %token EOF 0 EOF 0 | ^~~ input.y:3.8-10: previous declaration 3 | %token EOF 0 EOF 0 | ^~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:771: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:771" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:771" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:771: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:771" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:771" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:771: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:771" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:771" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:771: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:771" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:771" $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_16 #AT_START_17 at_fn_group_banner 17 'input.at:780' \ "Symbol class redefinition" " " 1 at_xfail=no ( $as_echo "17. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token FOO %nterm FOO BAR %token BAR %nterm error // The token error cannot be redefined as an nterm. %% FOO: BAR BAR: _ATEOF { set +x $as_echo "$at_srcdir/input.at:811: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:811" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.8-10: error: symbol FOO redeclared as a nonterminal 2 | %nterm FOO BAR | ^~~ input.y:1.8-10: previous definition 1 | %token FOO | ^~~ input.y:3.8-10: error: symbol BAR redeclared as a token 3 | %token BAR | ^~~ input.y:2.12-14: previous definition 2 | %nterm FOO BAR | ^~~ input.y:4.8-12: error: symbol error redeclared as a nonterminal 4 | %nterm error // The token error cannot be redefined as an nterm. | ^~~~~ input.y:6.1-3: error: rule given for FOO, which is a token 6 | FOO: BAR | ^~~ " | \ $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:811" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_17 #AT_START_18 at_fn_group_banner 18 'input.at:820' \ "Default %printer and %destructor redeclared" " " 1 at_xfail=no ( $as_echo "18. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST([*]) # ------------ cat >input.y <<'_ATEOF' %destructor { destroy ($$); } <> <> %printer { print ($$); } <> <> %destructor { destroy ($$); } <> %printer { print ($$); } <> %% start: %empty; %destructor { destroy ($$); } <>; %printer { print ($$); } <>; _ATEOF { set +x $as_echo "$at_srcdir/input.at:880: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:880" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.13-29: error: %destructor redeclaration for <> 1 | %destructor { destroy (\$\$); } <> <> | ^~~~~~~~~~~~~~~~~ input.y:1.13-29: previous declaration 1 | %destructor { destroy (\$\$); } <> <> | ^~~~~~~~~~~~~~~~~ input.y:2.10-24: error: %printer redeclaration for <> 2 | %printer { print (\$\$); } <> <> | ^~~~~~~~~~~~~~~ input.y:2.10-24: previous declaration 2 | %printer { print (\$\$); } <> <> | ^~~~~~~~~~~~~~~ input.y:4.13-29: error: %destructor redeclaration for <> 4 | %destructor { destroy (\$\$); } <> | ^~~~~~~~~~~~~~~~~ input.y:1.13-29: previous declaration 1 | %destructor { destroy (\$\$); } <> <> | ^~~~~~~~~~~~~~~~~ input.y:5.10-24: error: %printer redeclaration for <> 5 | %printer { print (\$\$); } <> | ^~~~~~~~~~~~~~~ input.y:2.10-24: previous declaration 2 | %printer { print (\$\$); } <> <> | ^~~~~~~~~~~~~~~ input.y:11.13-29: error: %destructor redeclaration for <> 11 | %destructor { destroy (\$\$); } <>; | ^~~~~~~~~~~~~~~~~ input.y:1.13-29: previous declaration 1 | %destructor { destroy (\$\$); } <> <> | ^~~~~~~~~~~~~~~~~ input.y:12.10-24: error: %printer redeclaration for <> 12 | %printer { print (\$\$); } <>; | ^~~~~~~~~~~~~~~ input.y:2.10-24: previous declaration 2 | %printer { print (\$\$); } <> <> | ^~~~~~~~~~~~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:880" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %destructor { destroy ($$); } <> <> %printer { print ($$); } <> <> %destructor { destroy ($$); } <> %printer { print ($$); } <> %% start: %empty; %destructor { destroy ($$); } <>; %printer { print ($$); } <>; _ATEOF { set +x $as_echo "$at_srcdir/input.at:881: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:881" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.13-29: error: %destructor redeclaration for <> 1 | %destructor { destroy (\$\$); } <> <> | ^~~~~~~~~~~~~~~~~ input.y:1.13-29: previous declaration 1 | %destructor { destroy (\$\$); } <> <> | ^~~~~~~~~~~~~~~~~ input.y:2.10-24: error: %printer redeclaration for <> 2 | %printer { print (\$\$); } <> <> | ^~~~~~~~~~~~~~~ input.y:2.10-24: previous declaration 2 | %printer { print (\$\$); } <> <> | ^~~~~~~~~~~~~~~ input.y:4.13-29: error: %destructor redeclaration for <> 4 | %destructor { destroy (\$\$); } <> | ^~~~~~~~~~~~~~~~~ input.y:1.13-29: previous declaration 1 | %destructor { destroy (\$\$); } <> <> | ^~~~~~~~~~~~~~~~~ input.y:5.10-24: error: %printer redeclaration for <> 5 | %printer { print (\$\$); } <> | ^~~~~~~~~~~~~~~ input.y:2.10-24: previous declaration 2 | %printer { print (\$\$); } <> <> | ^~~~~~~~~~~~~~~ input.y:11.13-29: error: %destructor redeclaration for <> 11 | %destructor { destroy (\$\$); } <>; | ^~~~~~~~~~~~~~~~~ input.y:1.13-29: previous declaration 1 | %destructor { destroy (\$\$); } <> <> | ^~~~~~~~~~~~~~~~~ input.y:12.10-24: error: %printer redeclaration for <> 12 | %printer { print (\$\$); } <>; | ^~~~~~~~~~~~~~~ input.y:2.10-24: previous declaration 2 | %printer { print (\$\$); } <> <> | ^~~~~~~~~~~~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:881" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:891' \ "Per-type %printer and %destructor redeclared" " " 1 at_xfail=no ( $as_echo "19. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %destructor { destroy ($$); } %printer { print ($$); } %destructor { destroy ($$); } %printer { print ($$); } %% start: %empty; %destructor { destroy ($$); } ; %printer { print ($$); } ; _ATEOF { set +x $as_echo "$at_srcdir/input.at:925: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:925" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.13-29: error: %destructor redeclaration for input.y:1.13-29: previous declaration input.y:4.13-29: error: %destructor redeclaration for input.y:1.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:2.10-24: previous declaration input.y:11.13-29: error: %destructor redeclaration for input.y:1.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:2.10-24: previous declaration " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:925" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:934' \ "Undefined symbols" " " 1 at_xfail=no ( $as_echo "20. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %printer {} foo baz %destructor {} bar %type qux %% exp: bar; _ATEOF { set +x $as_echo "$at_srcdir/input.at:957: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:957" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.13-15: warning: symbol 'foo' is used, but is not defined as a token and has no rules [-Wother] 1 | %printer {} foo baz | ^~~ input.y:1.17-19: warning: symbol 'baz' is used, but is not defined as a token and has no rules [-Wother] 1 | %printer {} foo baz | ^~~ input.y:2.16-18: error: symbol 'bar' is used, but is not defined as a token and has no rules 2 | %destructor {} bar | ^~~ input.y:3.13-15: warning: symbol 'qux' is used, but is not defined as a token and has no rules [-Wother] 3 | %type qux | ^~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:957" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:966' \ "Unassociated types used for a printer or destructor" "" 1 at_xfail=no ( $as_echo "21. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token tag1 %type tag2 %printer { } %destructor { } %% exp: tag1 { $1; } | tag2 { $1; } tag2: "a" { $$; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:986: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:986" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:986" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:986: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:986" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:986" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:986: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:986" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:986" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:986: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:986" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:986" $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:986: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:986" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.22-28: warning: type is used, but is not associated to any symbol [-Wother] input.y:5.25-31: warning: type is used, but is not associated to any symbol [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:986" $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:986: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:986" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:986" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:4.22-28: warning: type is used, but is not associated to any symbol [-Wother] input.y:5.25-31: warning: type is used, but is not associated to any symbol [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:986: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:986" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:986" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:986: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:986" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:986" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:986: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:986" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:986" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:986: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:986" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:986" $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_21 #AT_START_22 at_fn_group_banner 22 'input.at:995' \ "Useless printers or destructors" " " 1 at_xfail=no ( $as_echo "22. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST([INPUT], [STDERR]) # -------------------------- cat >input.y <<'_ATEOF' %token token1 %token token2 %token token3 %token token4 %token token51 token52 %token token61 token62 %token token7 %printer {} token1 %destructor {} token2 %printer {} token51 %destructor {} token61 %printer {} token7 %printer {} %destructor {} %printer {} %destructor {} %printer {} %destructor {} %destructor {} %% exp: "a"; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1034: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1034" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1034" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1034: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1034" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1034" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1034: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1034" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1034" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1034: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1034" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1034" $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:1034: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:1034" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:16.13-19: warning: useless %printer for type [-Wother] input.y:17.16-22: warning: useless %destructor for type [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1034" $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:1034: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1034" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1034" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:16.13-19: warning: useless %printer for type [-Wother] input.y:17.16-22: warning: useless %destructor for type [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1034: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1034" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1034" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1034: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1034" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1034" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1034: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1034" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1034" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1034: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1034" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1034" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi # If everybody is typed, <> is useless. cat >input.y <<'_ATEOF' %type exp %token a %printer {} <> <*> %% exp: a; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1042: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1042" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1042" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1042: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1042" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1042" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1042: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1042" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1042" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1042: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1042" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1042" $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:1042: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:1042" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.13-14: warning: useless %printer for type <> [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1042" $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:1042: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1042" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1042" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:3.13-14: warning: useless %printer for type <> [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1042: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1042" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1042" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1042: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1042" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1042" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1042: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1042" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1042" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1042: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1042" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1042" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi # If nobody is typed, <*> is useless. cat >input.y <<'_ATEOF' %token a %printer {} <> <*> %% exp: a; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1049: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1049" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1049" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1049: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1049" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1049" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1049: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1049" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1049" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1049: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1049" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1049" $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:1049: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:1049" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.16-18: warning: useless %printer for type <*> [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1049" $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:1049: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1049" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1049" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.16-18: warning: useless %printer for type <*> [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1049: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1049" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1049" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1049: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1049" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1049" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1049: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1049" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1049" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1049: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1049" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1049" $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_22 #AT_START_23 at_fn_group_banner 23 'input.at:1060' \ "Unused values with default %destructor" " " 1 at_xfail=no ( $as_echo "23. $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:1083: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1083" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1083" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1083: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:1083" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1083" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1083: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1083" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1083" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1083: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1083" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1083" $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:1083: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "input.at:1083" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:6.8-45: warning: unset value: \$\$ [-Wother] 6 | start: end end tagged tagged { \$1; \$3; } ; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:6.12-14: warning: unused value: \$2 [-Wother] 6 | start: end end tagged tagged { \$1; \$3; } ; | ^~~ input.y:7.6-8: warning: unset value: \$\$ [-Wother] 7 | end: { } ; | ^~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1083" $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:1083: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:1083" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1083" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:6.8-45: warning: unset value: $$ [-Wother] 6 | start: end end tagged tagged { $1; $3; } ; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:6.12-14: warning: unused value: $2 [-Wother] 6 | start: end end tagged tagged { $1; $3; } ; | ^~~ input.y:7.6-8: warning: unset value: $$ [-Wother] 7 | end: { } ; | ^~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1083: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1083" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1083" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1083: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:1083" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1083" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1083: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:1083" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1083" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1083: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:1083" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1083" $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:1099: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1099" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1099" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1099: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1099" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1099" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1099: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1099" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1099" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1099: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1099" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1099" $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:1099: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:1099" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:6.23-28: warning: unused value: \$4 [-Wother] input.y:8.9-11: warning: unset value: \$\$ [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1099" $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:1099: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1099" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1099" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:6.23-28: warning: unused value: $4 [-Wother] input.y:8.9-11: warning: unset value: $$ [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1099: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1099" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1099" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1099: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1099" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1099" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1099: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1099" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1099" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1099: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1099" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1099" $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:1108' \ "Unused values with per-type %destructor" " " 1 at_xfail=no ( $as_echo "24. $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:1130: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1130" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1130: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:1130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1130" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1130: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1130" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1130" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1130: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1130" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1130" $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:1130: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "input.at:1130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:6.8-22: warning: unset value: \$\$ [-Wother] 6 | start: end end { \$1; } ; | ^~~~~~~~~~~~~~~ input.y:6.12-14: warning: unused value: \$2 [-Wother] 6 | start: end end { \$1; } ; | ^~~ input.y:7.6-8: warning: unset value: \$\$ [-Wother] 7 | end: { } ; | ^~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1130" $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:1130: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:1130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1130" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:6.8-22: warning: unset value: $$ [-Wother] 6 | start: end end { $1; } ; | ^~~~~~~~~~~~~~~ input.y:6.12-14: warning: unused value: $2 [-Wother] 6 | start: end end { $1; } ; | ^~~ input.y:7.6-8: warning: unset value: $$ [-Wother] 7 | end: { } ; | ^~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1130: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1130" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1130" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1130: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:1130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1130" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1130: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:1130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1130" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1130: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:1130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1130" $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_24 #AT_START_25 at_fn_group_banner 25 'input.at:1140' \ "Duplicate string" " " 1 at_xfail=no ( $as_echo "25. $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/input.at:1159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1159" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "input.at:1159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1159" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1159: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1159" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1159" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1159: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1159" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1159" $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:1159: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y" at_fn_check_prepare_trace "input.at:1159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:6.11-14: warning: symbol \"<=\" used more than once as a literal string [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1159" $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:1159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Werror" "input.at:1159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1159" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:6.11-14: warning: symbol "<=" used more than once as a literal string [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1159: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1159" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1159" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=error" "input.at:1159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1159" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Wnone,none -Werror --trace=none" "input.at:1159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1159" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=none -Werror --trace=none" "input.at:1159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1159" $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_25 #AT_START_26 at_fn_group_banner 26 'input.at:1168' \ "Token collisions" " " 1 at_xfail=no ( $as_echo "26. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token FOO 42 "foo" BAR 42 "foo" %% exp: FOO BAR; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1187: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1187" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.17-21: warning: symbol \"foo\" used more than once as a literal string [-Wother] 2 | BAR 42 \"foo\" | ^~~~~ input.y:2.10-12: error: user token number 42 redeclaration for BAR 2 | BAR 42 \"foo\" | ^~~ input.y:1.15-19: previous declaration for \"foo\" 1 | %token FOO 42 \"foo\" | ^~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1187" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1196' \ "Incompatible Aliases" " " 1 at_xfail=no ( $as_echo "27. $at_setup_line: testing $at_desc ..." $at_traceon # Use the string-alias first to check the order between "first # declaration" and second. cat >input.y <<'_ATEOF' %token foo "foo" %type "foo" %type foo %% exp: foo; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1218: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1218" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.7-11: error: %type redeclaration for foo 3 | %type foo | ^~~~~ input.y:2.7-11: previous declaration 2 | %type \"foo\" | ^~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1218" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %token foo "foo" %printer {bar} "foo" %printer {baz} foo %% exp: foo; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1232: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1232" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.10-14: error: %printer redeclaration for foo 3 | %printer {baz} foo | ^~~~~ input.y:2.10-14: previous declaration 2 | %printer {bar} \"foo\" | ^~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1232" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %token foo "foo" %destructor {bar} "foo" %destructor {baz} foo %% exp: foo; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1246: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1246" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.13-17: error: %destructor redeclaration for foo 3 | %destructor {baz} foo | ^~~~~ input.y:2.13-17: previous declaration 2 | %destructor {bar} \"foo\" | ^~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1246" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %token foo "foo" %left "foo" %left foo %% exp: foo; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1260: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1260" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-5: error: %left redeclaration for foo 3 | %left foo | ^~~~~ input.y:2.1-5: previous declaration 2 | %left \"foo\" | ^~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1260" $at_failed && at_fn_log_failure $at_traceon; } # This time, declare the alias after its use. # Precedence/associativity. cat >input.y <<'_ATEOF' %left "foo" %left foo %token foo "foo" %% exp: foo; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1277: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1277" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-5: error: %left redeclaration for foo 2 | %left foo | ^~~~~ input.y:1.1-5: previous declaration 1 | %left \"foo\" | ^~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1277" $at_failed && at_fn_log_failure $at_traceon; } # Printer. cat >input.y <<'_ATEOF' %printer {} "foo" %printer {} foo %token foo "foo" %% exp: foo; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1292: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.10-11: error: %printer redeclaration for foo 2 | %printer {} foo | ^~ input.y:1.10-11: previous declaration 1 | %printer {} \"foo\" | ^~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1292" $at_failed && at_fn_log_failure $at_traceon; } # Destructor. cat >input.y <<'_ATEOF' %destructor {} "foo" %destructor {} foo %token foo "foo" %% exp: foo; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1307: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.13-14: error: %destructor redeclaration for foo 2 | %destructor {} foo | ^~ input.y:1.13-14: previous declaration 1 | %destructor {} \"foo\" | ^~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1307" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1321' \ "Torturing the Scanner" " " 1 at_xfail=no ( $as_echo "28. $at_setup_line: testing $at_desc ..." $at_traceon : >input.y { set +x $as_echo "$at_srcdir/input.at:1327: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:1327" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1: error: syntax error, unexpected end of file " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1327" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' {} _ATEOF { set +x $as_echo "$at_srcdir/input.at:1337: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1337" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-2: error: syntax error, unexpected {...} 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:1337" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ /* 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[] = "]],"; %} %{ #include 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: %empty;|oline;;|output;;; output: '#' 'o' 'u' 't' 'p' 'u' 't' ' '; %% /* Exercise M4 quoting: ']]', [, 2. */ static YYSTYPE value_as_yystype (value val) { YYSTYPE res; res.ival = val; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static char const input[] = "[\1\2$@{@oline@__oline__\ #output "; /* " */ enum { input_elts = sizeof input }; (void) input_elts; static int toknum; assert (0 <= toknum && toknum < input_elts); yylval = value_as_yystype (input[toknum]); return input[toknum++]; } _ATEOF # Pacify Emacs'font-lock-mode: " cat >main.c <<'_ATEOF' typedef int value; #include "input.h" int yyparse (void); #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1463: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1463" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1463" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1463: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "input.at:1463" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1463" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1463: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1463" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1463" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1463: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1463" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1463" $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:1463: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -v -o input.c input.y" at_fn_check_prepare_trace "input.at:1463" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1463" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "input.at:1464" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/input.at:1464" { set +x $as_echo "$at_srcdir/input.at:1464: \$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:1464" ( $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:1464" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "input.at:1465" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/input.at:1465" { set +x $as_echo "$at_srcdir/input.at:1465: \$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:1465" ( $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:1465" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "input.at:1466" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/input.at:1466" { set +x $as_echo "$at_srcdir/input.at:1466: \$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:1466" ( $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:1466" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1469: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:1469" ( $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:1469" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1469: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "input.at:1469" ( $at_check_trace; 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:1469" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1478' \ "Typed symbol aliases" " " 1 at_xfail=no ( $as_echo "29. $at_setup_line: testing $at_desc ..." $at_traceon # Bison 2.0 broke typed symbol aliases - ensure they work. cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:1495: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1495" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1495" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1495: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1495" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1495" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1495: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1495" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1495" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1495: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1495" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1495" $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:1495: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "input.at:1495" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1495" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1518' \ "Require 1.0" " " 1 at_xfail=no ( $as_echo "30. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %require "1.0"; %% empty_file: %empty; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1518: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1518" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1518" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1518: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1518" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1518" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1518: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1518" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1518" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1518: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1518" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1518" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/input.at:1518: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "input.at:1518" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1518" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_30 #AT_START_31 at_fn_group_banner 31 'input.at:1519' \ "Require 3.5.4" " " 1 at_xfail=no ( $as_echo "31. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %require "3.5.4"; %% empty_file: %empty; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1519: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1519" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1519" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1519: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1519" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1519" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1519: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1519" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1519" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1519: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1519" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1519" $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:1519: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "input.at:1519" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1519" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1521' \ "Require 100.0" " " 1 at_xfail=no ( $as_echo "32. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %require "100.0"; %% empty_file: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "input.at:1521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 63 $at_status "$at_srcdir/input.at:1521" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1528' \ "String aliases for character tokens" " " 1 at_xfail=no ( $as_echo "33. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:1541: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1541" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1541" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1541: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1541" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1541" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1541: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1541" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1541" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1541: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1541" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1541" $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:1541: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "input.at:1541" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1541" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1551' \ "Symbols" " " 1 at_xfail=no ( $as_echo "34. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %token WITH-DASH %token WITHOUT_DASH "WITHOUT-DASH" %token WITH.PERIOD %token WITHOUT_PERIOD "WITHOUT.PERIOD" %code { #include static void yyerror (const char *msg); static int yylex (void); } %% start: with-dash without_dash with.period without_period; with-dash: WITH-DASH; without_dash: "WITHOUT-DASH"; with.period: WITH.PERIOD; without_period: "WITHOUT.PERIOD"; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } _ATEOF # POSIX Yacc accept periods, but not dashes. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1584: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --yacc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1584" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --yacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1584" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1584: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --yacc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --yacc input.y" "input.at:1584" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --yacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1584" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1584: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1584" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1584" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1584: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1584" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1584" $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:1584: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --yacc input.y" at_fn_check_prepare_trace "input.at:1584" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --yacc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-5: warning: POSIX Yacc does not support %code [-Wyacc] input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Wyacc] input.y:10.21-34: warning: POSIX Yacc does not support string literals [-Wyacc] input.y:12.23-38: warning: POSIX Yacc does not support string literals [-Wyacc] input.y:13.1-5: warning: POSIX Yacc does not support %code [-Wyacc] input.y:20.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash [-Wyacc] input.y:22.15-28: warning: POSIX Yacc does not support string literals [-Wyacc] input.y:24.17-32: warning: POSIX Yacc does not support string literals [-Wyacc] " | \ $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:1584" $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:1584: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Werror" "input.at:1584" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc 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:1584" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:1.1-5: warning: POSIX Yacc does not support %code [-Wyacc] input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Wyacc] input.y:10.21-34: warning: POSIX Yacc does not support string literals [-Wyacc] input.y:12.23-38: warning: POSIX Yacc does not support string literals [-Wyacc] input.y:13.1-5: warning: POSIX Yacc does not support %code [-Wyacc] input.y:20.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash [-Wyacc] input.y:22.15-28: warning: POSIX Yacc does not support string literals [-Wyacc] input.y:24.17-32: warning: POSIX Yacc does not support string literals [-Wyacc] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1584: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1584" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1584" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1584: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=error" "input.at:1584" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc 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:1584" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1584: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Wnone,none -Werror --trace=none" "input.at:1584" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1584" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1584: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=none -Werror --trace=none" "input.at:1584" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1584" $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:1587: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1587" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1587" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1587: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1587" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1587" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1587: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1587" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1587" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1587: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1587" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1587" $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:1587: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "input.at:1587" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1587" $at_failed && at_fn_log_failure $at_traceon; } # Make sure we don't export silly token identifiers with periods or dashes. $as_echo "input.at:1590" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/input.at:1590" { set +x $as_echo "$at_srcdir/input.at:1590: \$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:1590" ( $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:1590" $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %token .GOOD -GOOD 1NV4L1D -123 %% start: .GOOD GOOD _ATEOF { set +x $as_echo "$at_srcdir/input.at:1607: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "input.at:1607" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:10.10: error: invalid character: '-' input.y:11.10-16: error: invalid identifier: '1NV4L1D' input.y:12.10: error: invalid character: '-' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1607" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_34 #AT_START_35 at_fn_group_banner 35 'input.at:1617' \ "Numbered tokens" " " 1 at_xfail=no ( $as_echo "35. $at_setup_line: testing $at_desc ..." $at_traceon cat >redecl.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:1634: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret redecl.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret redecl.y" "input.at:1634" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret redecl.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "redecl.y:10.10-22: error: user token number 11259375 redeclaration for HEXADECIMAL_1 redecl.y:9.8-16: previous declaration for DECIMAL_1 redecl.y:12.10-18: error: user token number 16702650 redeclaration for DECIMAL_2 redecl.y:11.10-22: previous declaration for HEXADECIMAL_2 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1634" $at_failed && at_fn_log_failure $at_traceon; } cat >too-large.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:1649: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret too-large.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret too-large.y" "input.at:1649" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret too-large.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "too-large.y:9.22-42: error: integer out of range: '999999999999999999999' too-large.y:9.22-42: error: user token number of TOO_LARGE_DEC too large too-large.y:10.24-44: error: integer out of range: '0xFFFFFFFFFFFFFFFFFFF' too-large.y:10.24-44: error: user token number of TOO_LARGE_HEX too large " | \ $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:1649" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1659' \ "Unclosed constructs" " " 1 at_xfail=no ( $as_echo "36. $at_setup_line: testing $at_desc ..." $at_traceon # Bison's scan-gram.l once forgot to STRING_FINISH some unclosed # constructs, so they were prepended to whatever it STRING_GROW'ed # next. It also threw them away rather than returning them to the # parser. The effect was confusing subsequent error messages. cat >input.y <<'_ATEOF' %token A "a %token B "b" %token AB "ab" // Used to complain that "ab" was already used. %token C '1 %token TWO "2" %token TICK_TWELVE "'12" // Used to complain that "'12" was already used. %% start: %empty; // Used to report a syntax error because it didn't see any kind of symbol // identifier. %type '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:1705: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" "input.at:1705" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.10-2.0: error: missing '\"' at end of line 1 | %token A \"a | ^~ input.y:4.10-5.0: error: missing \"'\" at end of line 4 | %token C '1 | ^~ input.y:14.11-15.0: error: missing \"'\" at end of line 14 | %type 'a | ^~ input.y:16.11-17.0: error: missing '\"' at end of line 16 | %type \"a | ^~ input.y:19.13-20.0: error: missing '}' at end of file 19 | %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:1705" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1714' \ "%start after first rule" " " 1 at_xfail=no ( $as_echo "37. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once complained that a %start after the first rule was a # redeclaration of the start symbol. cat >input.y <<'_ATEOF' %% false_start: %empty; start: false_start ; %start start; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1726: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1726" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1726" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1726: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1726" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1726" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1726: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1726" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1726" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1726: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1726" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1726" $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:1726: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "input.at:1726" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1726" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:1735' \ "%prec takes a token" " " 1 at_xfail=no ( $as_echo "38. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once allowed %prec sym where sym was a nonterminal. cat >input.y <<'_ATEOF' %% start: PREC %prec PREC ; PREC: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1747: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:1747" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-4: error: rule given for PREC, which is a token " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1747" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_38 #AT_START_39 at_fn_group_banner 39 'input.at:1756' \ "%prec's token must be defined" " " 1 at_xfail=no ( $as_echo "39. $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:1767: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1767" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1767" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1767: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1767" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1767" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1767: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1767" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1767" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1767: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1767" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1767" $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:1767: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:1767" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.8-17: warning: token for %prec is not defined: PREC [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1767" $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:1767: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1767" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1767" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.8-17: warning: token for %prec is not defined: PREC [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:1767: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1767" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1767" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:1767: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1767" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1767" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:1767: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1767" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1767" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1767: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1767" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1767" $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_39 #AT_START_40 at_fn_group_banner 40 'input.at:1776' \ "Reject unused %code qualifiers" " " 1 at_xfail=no ( $as_echo "40. $at_setup_line: testing $at_desc ..." $at_traceon cat >input-c.y <<'_ATEOF' %code q {} %code bad {} %code bad {} %code format {} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1791: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c.y" "input.at:1791" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-c.y:1.7: error: %code qualifier 'q' is not used input-c.y:2.7-9: error: %code qualifier 'bad' is not used input-c.y:3.7-9: error: %code qualifier 'bad' is not used input-c.y:4.7-12: error: %code qualifier 'format' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1791" $at_failed && at_fn_log_failure $at_traceon; } cat >input-c-glr.y <<'_ATEOF' %code q {} %code bad {} %code bad {} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1804: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c-glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c-glr.y" "input.at:1804" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c-glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-c-glr.y:1.7: error: %code qualifier 'q' is not used input-c-glr.y:2.7-9: error: %code qualifier 'bad' is not used input-c-glr.y:3.8-10: error: %code qualifier 'bad' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1804" $at_failed && at_fn_log_failure $at_traceon; } cat >input-c++.y <<'_ATEOF' %code q {} %code bad {} %code q {} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1817: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++.y" "input.at:1817" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-c++.y:1.7: error: %code qualifier 'q' is not used input-c++.y:2.7-9: error: %code qualifier 'bad' is not used input-c++.y:3.8: error: %code qualifier 'q' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1817" $at_failed && at_fn_log_failure $at_traceon; } cat >input-c++-glr.y <<'_ATEOF' %code bad {} %code q {} %code q {} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1830: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++-glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++-glr.y" "input.at:1830" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++-glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-c++-glr.y:1.7-9: error: %code qualifier 'bad' is not used input-c++-glr.y:2.7: error: %code qualifier 'q' is not used input-c++-glr.y:3.7: error: %code qualifier 'q' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1830" $at_failed && at_fn_log_failure $at_traceon; } cat >special-char-@@.y <<'_ATEOF' %code bad {} %code q {} %code q {} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1843: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-@@.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-@@.y" "input.at:1843" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-@@.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "special-char-@@.y:1.7-9: error: %code qualifier 'bad' is not used special-char-@@.y:2.7: error: %code qualifier 'q' is not used special-char-@@.y:3.7: error: %code qualifier 'q' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1843" $at_failed && at_fn_log_failure $at_traceon; } cat >special-char-].y <<'_ATEOF' %code bad {} %code q {} %code q {} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1856: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-].y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-].y" "input.at:1856" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-].y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "special-char-].y:1.7-9: error: %code qualifier 'bad' is not used special-char-].y:2.7: error: %code qualifier 'q' is not used special-char-].y:3.7: error: %code qualifier 'q' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1856" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_40 #AT_START_41 at_fn_group_banner 41 'input.at:1865' \ "Multiple %code" " " 1 at_xfail=no ( $as_echo "41. $at_setup_line: testing $at_desc ..." $at_traceon # Make sure that repeated arguments to %code are separated by # end-of-lines. At some point, a missing eol would leave synclines # appended to the previous value. Here, we use CPP directive to # introduce dependency on the absence/presence of the eol. cat >input.y <<'_ATEOF' %code {#include } %code {#define A B} %code {#define B C} %code {#define C D} %code {#define D 42} %code { #include static void yyerror (const char *msg); static int yylex (void); } %% start: %empty; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } int main (void) { assert (A == 42); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1894: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1894" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1894" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1894: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1894" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1894" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1894: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1894" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1894" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1894: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1894" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1894" $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:1894: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "input.at:1894" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1894" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "input.at:1894" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/input.at:1894" { set +x $as_echo "$at_srcdir/input.at:1894: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "input.at:1894" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1894" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1895: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:1895" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1895" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1895: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "input.at:1895" ( $at_check_trace; 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:1895" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_41 #AT_START_42 at_fn_group_banner 42 'input.at:1905' \ "errors" " " 1 at_xfail=no ( $as_echo "42. $at_setup_line: testing $at_desc ..." $at_traceon cat >input-redefined.y <<'_ATEOF' %define var "value1" %define var "value1" %define var "value2" %define special1 "]" %define special2 "[" %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1923: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-redefined.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-redefined.y" "input.at:1923" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-redefined.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-redefined.y:2.1-20: warning: %define variable 'var' redefined [-Wother] input-redefined.y:1.1-20: previous definition input-redefined.y:3.2-21: error: %define variable 'var' redefined input-redefined.y:2.1-20: previous definition input-redefined.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1923" $at_failed && at_fn_log_failure $at_traceon; } cat >input-unused.y <<'_ATEOF' %define var "value" %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1933: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-unused.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-unused.y" "input.at:1933" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-unused.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-unused.y:1.1-19: 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:1933" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_42 #AT_START_43 at_fn_group_banner 43 'input.at:1942' \ "%define, --define, --force-define" " " 1 at_xfail=no ( $as_echo "43. $at_setup_line: testing $at_desc ..." $at_traceon cat >skel.c <<'_ATEOF' m4_divert_push(0)@ @output(b4_parser_file_name@)@ [var-dd: ]b4_percent_define_get([[var-dd]])[ var-ff: ]b4_percent_define_get([[var-ff]])[ var-dfg: ]b4_percent_define_get([[var-dfg]])[ var-fd: ]b4_percent_define_get([[var-fd]]) m4_divert_pop(0) _ATEOF cat >input.y <<'_ATEOF' %define var-dfg "gram" %% start: %empty; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:1962: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -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:1962" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1962" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1962: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \\ --skeleton ./skel.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1962" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \ --skeleton ./skel.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:1962" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:1962: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1962" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1962" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:1962: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1962" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1962" $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:1962: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \\ --skeleton ./skel.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:1962" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \ -Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \ -Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \ -Fvar-fd=cmd-f -Dvar-fd=cmd-d \ --skeleton ./skel.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:1962" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:1968: cat input.tab.c" at_fn_check_prepare_trace "input.at:1968" ( $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:1968" $at_failed && at_fn_log_failure $at_traceon; } cat >input-dg.y <<'_ATEOF' %define var "gram" %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1979: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dvar=cmd-d input-dg.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dvar=cmd-d input-dg.y" "input.at:1979" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dvar=cmd-d input-dg.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-dg.y:1.1-18: error: %define variable 'var' redefined :3: previous definition input-dg.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1979" $at_failed && at_fn_log_failure $at_traceon; } cat >input-dg.y <<'_ATEOF' %define var "gram" %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:1992: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Dvar=cmd-d input-dg.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Dvar=cmd-d input-dg.y" "input.at:1992" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Dvar=cmd-d input-dg.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-dg.y:1.1-18: error: %define variable 'var' redefined 1 | %define var \"gram\" | ^~~~~~~~~~~~~~~~~~ :4: previous definition input-dg.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:1992" $at_failed && at_fn_log_failure $at_traceon; } cat >input-unused.y <<'_ATEOF' %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2001: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dunused-d -Funused-f input-unused.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dunused-d -Funused-f input-unused.y" "input.at:2001" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dunused-d -Funused-f input-unused.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: error: %define variable 'unused-d' is not used :4: 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:2001" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_43 #AT_START_44 at_fn_group_banner 44 'input.at:2010' \ "\"%define\" Boolean variables" " " 1 at_xfail=no ( $as_echo "44. $at_setup_line: testing $at_desc ..." $at_traceon cat >Input.y <<'_ATEOF' %language "Java" %define api.parser.class {Input} %define api.parser.public {maybe} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2022: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret Input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret Input.y" "input.at:2022" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret Input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Input.y:3.1-33: error: invalid value for %define Boolean variable 'api.parser.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:2022" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_44 #AT_START_45 at_fn_group_banner 45 'input.at:2031' \ "\"%define\" code variables" " " 1 at_xfail=no ( $as_echo "45. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %skeleton "lalr1.cc" %locations %define api.location.type quux %define api.namespace quux %define api.prefix quux %define api.token.prefix quux %token TOK // Otherwise api.token.prefix is unused. %% start: TOK; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2053: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.yy" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2053: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy" "input.at:2053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2053" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2053: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2053" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2053" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2053: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2053" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2053" $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:2053: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.yy" at_fn_check_prepare_trace "input.at:2053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.yy:2.1-30: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated] input.yy:4.1-30: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated] input.yy:5.1-30: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated] input.yy:3.1-30: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2053" $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:2053: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror" "input.at:2053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2053" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.yy:2.1-30: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated] input.yy:4.1-30: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated] input.yy:5.1-30: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated] input.yy:3.1-30: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2053: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2053" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2053" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2053: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error" "input.at:2053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2053" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2053: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none" "input.at:2053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2053: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none" "input.at:2053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2053" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi cat >input.yy <<'_ATEOF' %skeleton "lalr1.cc" %locations %define api.location.type "quux" %define api.namespace "quux" %define api.prefix "quux" %define api.token.prefix "quux" %token TOK // Otherwise api.token.prefix is unused. %% start: TOK; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2054: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.yy" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2054: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy" "input.at:2054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2054: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2054" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2054" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2054: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2054" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2054" $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:2054: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.yy" at_fn_check_prepare_trace "input.at:2054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.yy:2.1-32: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated] input.yy:4.1-32: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated] input.yy:5.1-32: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated] input.yy:3.1-32: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054" $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:2054: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror" "input.at:2054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2054" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.yy:2.1-32: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated] input.yy:4.1-32: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated] input.yy:5.1-32: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated] input.yy:3.1-32: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2054: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2054" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2054: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error" "input.at:2054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2054" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2054: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none" "input.at:2054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2054: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none" "input.at:2054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2054" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_45 #AT_START_46 at_fn_group_banner 46 'input.at:2064' \ "\"%define\" keyword variables" " " 1 at_xfail=no ( $as_echo "46. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %define api.pure "true" %define api.push-pull "both" %define lr.default-reduction "most" %define lr.keep-unreachable-state "true" %define lr.type "lalr" %% exp: %empty _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2086: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2086" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2086" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2086: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2086" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2086" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2086: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2086" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2086" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2086: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2086" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2086" $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:2086: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:2086" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:5.1-40: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated] input.y:3.1-40: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated] input.y:4.1-40: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated] input.y:1.1-38: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated] input.y:2.1-40: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2086" $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:2086: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:2086" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2086" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:5.1-40: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated] input.y:3.1-40: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated] input.y:4.1-40: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated] input.y:1.1-38: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated] input.y:2.1-40: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2086: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2086" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2086" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2086: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:2086" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2086" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2086: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:2086" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2086" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2086: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:2086" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2086" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi cat >input.y <<'_ATEOF' %define api.pure {true} %define api.push-pull {both} %define lr.default-reduction {most} %define lr.keep-unreachable-state {true} %define lr.type {lalr} %% exp: %empty _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2087: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2087" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2087" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2087: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2087" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2087" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2087: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2087" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2087" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2087: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2087" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2087" $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:2087: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:2087" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:5.1-40: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated] input.y:3.1-40: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated] input.y:4.1-40: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated] input.y:1.1-38: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated] input.y:2.1-40: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2087" $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:2087: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:2087" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2087" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:5.1-40: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated] input.y:3.1-40: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated] input.y:4.1-40: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated] input.y:1.1-38: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated] input.y:2.1-40: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2087: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2087" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2087" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2087: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:2087" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2087" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2087: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:2087" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2087" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2087: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:2087" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2087" $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_46 #AT_START_47 at_fn_group_banner 47 'input.at:2097' \ "\"%define\" enum variables" " " 1 at_xfail=no ( $as_echo "47. $at_setup_line: testing $at_desc ..." $at_traceon # Check errors from the front-end, and the back-end. Since the # front-end quits before calling the back-end, these tests cannot be # fused. # Front-end. cat >input.y <<'_ATEOF' %define lr.default-reduction bogus %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2116: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2116" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-34: error: invalid value for %define variable 'lr.default-reduction': 'bogus' 1 | %define lr.default-reduction bogus | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:1.1-34: accepted value: 'most' input.y:1.1-34: accepted value: 'consistent' input.y:1.1-34: 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:2116" $at_failed && at_fn_log_failure $at_traceon; } # Check escapes. cat >input.y <<'_ATEOF' %define lr.default-reduction {[$@]} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2134: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2134" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-35: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated] 1 | %define lr.default-reduction {[\$@]} | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:1.1-35: error: invalid value for %define variable 'lr.default-reduction': '[\$@]' 1 | %define lr.default-reduction {[\$@]} | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:1.1-35: accepted value: 'most' input.y:1.1-35: accepted value: 'consistent' input.y:1.1-35: 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:2134" $at_failed && at_fn_log_failure $at_traceon; } # Back-end. cat >input.y <<'_ATEOF' %define api.push-pull neither %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2150: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2150" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-29: error: invalid value for %define variable 'api.push-pull': 'neither' 1 | %define api.push-pull neither | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:1.1-29: accepted value: 'pull' input.y:1.1-29: accepted value: 'push' input.y:1.1-29: 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:2150" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_47 #AT_START_48 at_fn_group_banner 48 'input.at:2160' \ "\"%define\" file variables" " " 1 at_xfail=no ( $as_echo "48. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %skeleton "lalr1.cc" %locations %define api.location.file {bogus} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2173: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2173" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-33: error: %define variable 'api.location.file' requires 'none' or '\"...\"' values 3 | %define api.location.file {bogus} | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " | \ $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:2173" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_48 #AT_START_49 at_fn_group_banner 49 'input.at:2182' \ "\"%define\" backward compatibility" " " 1 at_xfail=no ( $as_echo "49. $at_setup_line: testing $at_desc ..." $at_traceon # The error messages tell us whether the variables are properly updated. cat >input.y <<'_ATEOF' %define api.push_pull both %define lr.keep_unreachable_states maybe %define namespace "foo" %define variant %define parser_class_name {parser} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2219: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2219" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-26: warning: deprecated directive: '%define api.push_pull both', use '%define api.push-pull both' [-Wdeprecated] 1 | %define api.push_pull both | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | %define api.push-pull both input.y:2.1-40: warning: deprecated directive: '%define lr.keep_unreachable_states maybe', use '%define lr.keep-unreachable-state maybe' [-Wdeprecated] 2 | %define lr.keep_unreachable_states maybe | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | %define lr.keep-unreachable-state maybe input.y:3.1-23: warning: deprecated directive: '%define namespace \"foo\"', use '%define api.namespace {foo}' [-Wdeprecated] 3 | %define namespace \"foo\" | ^~~~~~~~~~~~~~~~~~~~~~~ | %define api.namespace {foo} input.y:4.1-15: warning: deprecated directive: '%define variant', use '%define api.value.type variant' [-Wdeprecated] 4 | %define variant | ^~~~~~~~~~~~~~~ | %define api.value.type variant input.y:5.1-34: warning: deprecated directive: '%define parser_class_name {parser}', use '%define api.parser.class {parser}' [-Wdeprecated] 5 | %define parser_class_name {parser} | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | %define api.parser.class {parser} input.y:2.1-40: error: invalid value for %define Boolean variable 'lr.keep-unreachable-state' 2 | %define lr.keep_unreachable_states maybe | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2219" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2228' \ "Unused api.pure" " " 1 at_xfail=no ( $as_echo "50. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST(DECLS, VALUE, LOCATION) # ------------------------------- # Make sure Bison reports that '%define api.pure VALUE' is unused when DECLS # are specified. cat >input.y <<'_ATEOF' %define api.pure %language "c++" %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2248: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2248" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-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:2248" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure false %language "c++" %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2249: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2249" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-22: 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:2249" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure "" %language "c++" %glr-parser %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2250: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2250" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-19: 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:2250" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure false %language "c++" %glr-parser %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2251: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2251" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-22: 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:2251" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure true %language "java" %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2252: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2252" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-21: 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:2252" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.pure false %language "java" %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2253: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2253" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-22: 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:2253" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2264' \ "C++ namespace reference errors" " " 1 at_xfail=no ( $as_echo "51. $at_setup_line: testing $at_desc ..." $at_traceon # AT_CHECK_NAMESPACE_ERROR(NAMESPACE-DECL, ERROR, [ERROR], ...) # ------------------------------------------------------------- # Make sure Bison reports all ERROR's for %define namespace "NAMESPACE-DECL". cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2286: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2286" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-24: 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:2286" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace { } %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2288: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2288" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-57: 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:2288" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {foo::::bar} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2290: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2290" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-34: 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:2290" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {foo:: ::bar} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2292: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-38: 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:2292" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {::::bar} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2294: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2294" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-31: 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:2294" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {:: ::bar} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2296: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2296" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-32: 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:2296" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {foo::bar:: ::} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2299: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2299" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-43: error: namespace reference has consecutive \"::\" input.y:3.1-43: 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:2299" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {foo::bar::} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2301: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2301" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-34: 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:2301" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {foo::bar:: } %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-41: 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:2303" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %language "C++" %defines %define api.namespace {::} %% start: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2305: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-26: 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:2305" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2317' \ "Bad character literals" " " 1 at_xfail=no ( $as_echo "52. $at_setup_line: testing $at_desc ..." $at_traceon cat >empty.y <<'_ATEOF' %% start: ''; start: ' start: ' _ATEOF { set +x $as_echo "$at_srcdir/input.at:2323: set x \`LC_ALL=C ls -l 'empty.y'\` && size=\$6 && { test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='empty.y'; } || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2323" ( $at_check_trace; set x `LC_ALL=C ls -l 'empty.y'` && size=$6 && { test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='empty.y'; } || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2323" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2341: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret empty.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret empty.y" "input.at:2341" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret empty.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "empty.y:2.8-9: warning: empty character literal [-Wother] 2 | start: ''; | ^~ empty.y:3.8-4.0: error: missing \"'\" at end of line 3 | start: ' | ^ empty.y:3.8-4.0: warning: empty character literal [-Wother] 3 | start: ' | ^ empty.y:4.8: error: missing \"'\" at end of file 4 | start: ' | ^ empty.y:4.8: warning: empty character literal [-Wother] 4 | start: ' | ^ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2341" $at_failed && at_fn_log_failure $at_traceon; } cat >two.y <<'_ATEOF' %% start: 'ab'; start: 'ab start: 'ab _ATEOF { set +x $as_echo "$at_srcdir/input.at:2347: set x \`LC_ALL=C ls -l 'two.y'\` && size=\$6 && { test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='two.y'; } || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2347" ( $at_check_trace; set x `LC_ALL=C ls -l 'two.y'` && size=$6 && { test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='two.y'; } || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2347" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2355: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret two.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret two.y" "input.at:2355" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret two.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "two.y:2.8-11: warning: extra characters in character literal [-Wother] two.y:3.8-4.0: error: missing \"'\" at end of line two.y:3.8-4.0: warning: extra characters in character literal [-Wother] two.y:4.8-10: error: missing \"'\" at end of file two.y:4.8-10: warning: extra characters in character literal [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2355" $at_failed && at_fn_log_failure $at_traceon; } cat >three.y <<'_ATEOF' %% start: 'abc'; start: 'abc start: 'abc _ATEOF { set +x $as_echo "$at_srcdir/input.at:2361: set x \`LC_ALL=C ls -l 'three.y'\` && size=\$6 && { test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='three.y'; } || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2361" ( $at_check_trace; set x `LC_ALL=C ls -l 'three.y'` && size=$6 && { test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='three.y'; } || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2361" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2369: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret three.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret three.y" "input.at:2369" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret three.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "three.y:2.8-12: warning: extra characters in character literal [-Wother] three.y:3.8-4.0: error: missing \"'\" at end of line three.y:3.8-4.0: warning: extra characters in character literal [-Wother] three.y:4.8-11: error: missing \"'\" at end of file three.y:4.8-11: warning: extra characters in character literal [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2369" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2378' \ "Bad escapes in literals" " " 1 at_xfail=no ( $as_echo "53. $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:2391: \"\$PERL\" -e 'print \"start: \\\"\\\\\\t\\\\\\f\\\\\\0\\\\\\1\\\" ;\";' >> input.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -e 'print \"start: \\\"\\\\\\t\\\\\\f\\\\\\0\\\\\\1\\\" ;\";' >> input.y || exit 77" "input.at:2391" ( $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:2391" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2418: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2418" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.9-12: error: invalid number after \\-escape: 777 input.y:2.8-13: warning: empty character literal [-Wother] input.y:2.16-17: error: invalid number after \\-escape: 0 input.y:2.15-18: warning: empty character literal [-Wother] input.y:2.21-25: error: invalid number after \\-escape: xfff input.y:2.20-26: warning: empty character literal [-Wother] input.y:2.29-31: error: invalid number after \\-escape: x0 input.y:2.28-32: warning: empty character literal [-Wother] input.y:3.9-14: error: invalid number after \\-escape: uffff input.y:3.8-15: warning: empty character literal [-Wother] input.y:3.18-23: error: invalid number after \\-escape: u0000 input.y:3.17-24: warning: empty character literal [-Wother] input.y:3.27-36: error: invalid number after \\-escape: Uffffffff input.y:3.26-37: warning: empty character literal [-Wother] input.y:3.40-49: error: invalid number after \\-escape: U00000000 input.y:3.39-50: warning: empty character literal [-Wother] input.y:4.9-10: error: invalid character after \\-escape: ' ' input.y:4.8-11: warning: empty character literal [-Wother] input.y:4.14-15: error: invalid character after \\-escape: A input.y:4.13-16: warning: empty character literal [-Wother] input.y:5.9-16: error: invalid character after \\-escape: \\t input.y:5.17: error: invalid character after \\-escape: \\f input.y:5.18: error: invalid character after \\-escape: \\0 input.y:5.19: error: invalid character after \\-escape: \\001 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2418" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2427' \ "LAC: Errors for %define" " " 1 at_xfail=no ( $as_echo "54. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% start: %empty; _ATEOF # Only "full" and "none" are accepted for parse.lac # Unknown values (such as "unsupported") are rejected if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:2437: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=none input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2437" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=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:2437" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2437: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=none input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=none input.y" "input.at:2437" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=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:2437" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2437: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2437" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2437" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2437: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2437" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2437" $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:2437: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=none input.y" at_fn_check_prepare_trace "input.at:2437" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=none input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:2437" $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:2438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=none -L c++ input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=none -L c++ input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=none -L c++ input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=none -L c++ input.y" "input.at:2438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=none -L c++ input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2438" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2438: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2438" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2438" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2438: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2438" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2438" $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:2438: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=none -L c++ input.y" at_fn_check_prepare_trace "input.at:2438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=none -L 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:2438" $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:2439: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2439" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2439" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2439: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full input.y" "input.at:2439" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2439" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2439: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2439" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2439" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2439: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2439" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2439" $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:2439: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full input.y" at_fn_check_prepare_trace "input.at:2439" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:2439" $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:2440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full -L c++ input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full -L c++ input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2440" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -L c++ input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -L c++ input.y" "input.at:2440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -L c++ input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2440" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2440" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2440" $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:2440: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -L c++ input.y" at_fn_check_prepare_trace "input.at:2440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -L 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:2440" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2446: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac=unsupported input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac=unsupported input.y" "input.at:2446" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac=unsupported input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: error: invalid value for %define variable 'parse.lac': 'unsupported' :3: accepted value: 'full' :3: accepted value: 'none' " | \ $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:2446" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2452: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac=unsupported -L c++ input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac=unsupported -L c++ input.y" "input.at:2452" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac=unsupported -L c++ input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: error: invalid value for %define variable 'parse.lac': 'unsupported' :3: accepted value: 'full' :3: accepted value: 'none' " | \ $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:2452" $at_failed && at_fn_log_failure $at_traceon; } # parse.lac.* options are useless if LAC isn't actually activated. { set +x $as_echo "$at_srcdir/input.at:2458: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 input.y" "input.at:2458" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: 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:2458" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2462: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.memory-trace=full input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.memory-trace=full input.y" "input.at:2462" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.memory-trace=full input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: 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:2462" $at_failed && at_fn_log_failure $at_traceon; } # parse.lac.* options are useless in C++ even if LAC isn't actually activated. { set +x $as_echo "$at_srcdir/input.at:2468: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 -L C++ -Dparse.lac=full input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 -L C++ -Dparse.lac=full input.y" "input.at:2468" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 -L C++ -Dparse.lac=full input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: 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:2468" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2472: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.memory-trace=full -L C++ -Dparse.lac=full input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.memory-trace=full -L C++ -Dparse.lac=full input.y" "input.at:2472" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.memory-trace=full -L C++ -Dparse.lac=full input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: 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:2472" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2481' \ "-Werror combinations" " " 1 at_xfail=no ( $as_echo "55. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% a: '0' { $$ = $; }; _ATEOF # -Werror is not enabled by -Wall or equivalent. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2491: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2491" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2491" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2491: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" "input.at:2491" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2491" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2491: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2491" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2491" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2491: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2491" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2491" $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:2491: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall input.y" at_fn_check_prepare_trace "input.at:2491" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.15: warning: stray '\$' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2491" $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:2491: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror" "input.at:2491" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2491" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.15: warning: stray '$' [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2491: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2491" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2491" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2491: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error" "input.at:2491" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2491" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2491: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none" "input.at:2491" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2491" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2491: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none" "input.at:2491" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2491" $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:2494: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -W input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2494" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2494" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2494: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -W input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -W input.y" "input.at:2494" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -W input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2494" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2494: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2494" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2494" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2494: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2494" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2494" $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:2494: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -W input.y" at_fn_check_prepare_trace "input.at:2494" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -W input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.15: warning: stray '\$' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2494" $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:2494: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Werror" "input.at:2494" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2494" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.15: warning: stray '$' [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2494: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2494" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2494" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2494: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=error" "input.at:2494" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2494" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2494: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Wnone,none -Werror --trace=none" "input.at:2494" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2494" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2494: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=none -Werror --trace=none" "input.at:2494" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2494" $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:2497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-none input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-none input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-none input.y" "input.at:2497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-none input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2497" $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:2497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-none input.y" at_fn_check_prepare_trace "input.at:2497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-none input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.15: warning: stray '\$' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2497" $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:2497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Werror" "input.at:2497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2497" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.15: warning: stray '$' [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2497: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2497" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2497" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=error" "input.at:2497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2497" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Wnone,none -Werror --trace=none" "input.at:2497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=none -Werror --trace=none" "input.at:2497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2497" $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:2502: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,none,other input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,none,other input.y" "input.at:2502" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,none,other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.15: error: stray '\$' [-Werror=other] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2502" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2505: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,no-all,other input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,no-all,other input.y" "input.at:2505" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,no-all,other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.15: error: stray '\$' [-Werror=other] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2505" $at_failed && at_fn_log_failure $at_traceon; } # Check that -Wno-error keeps warnings enabled, but non fatal. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2510: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Werror -Wno-error=other input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2510" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Werror -Wno-error=other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2510" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2510: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror -Wno-error=other input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror -Wno-error=other input.y" "input.at:2510" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror -Wno-error=other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2510" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2510: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2510" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2510" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2510: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2510" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2510" $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:2510: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Werror -Wno-error=other input.y" at_fn_check_prepare_trace "input.at:2510" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Werror -Wno-error=other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.15: warning: stray '\$' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2510" $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:2514: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-error=other -Werror input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-error=other -Werror input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2514" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2514: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-error=other -Werror input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-error=other -Werror input.y" "input.at:2514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-error=other -Werror input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2514" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2514: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2514" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2514" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2514: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2514" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2514" $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:2514: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-error=other -Werror input.y" at_fn_check_prepare_trace "input.at:2514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-error=other -Werror input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.15: warning: stray '\$' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2514" $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:2517: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Werror=other -Wno-other input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2517" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Werror=other -Wno-other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2517" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2517: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror=other -Wno-other input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror=other -Wno-other input.y" "input.at:2517" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror=other -Wno-other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2517" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2517: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2517" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2517" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2517: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2517" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2517" $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:2517: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Werror=other -Wno-other input.y" at_fn_check_prepare_trace "input.at:2517" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Werror=other -Wno-other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2517" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2526' \ "%name-prefix and api.prefix are incompatible" " " 1 at_xfail=no ( $as_echo "56. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST(DIRECTIVES, OPTIONS, ERROR-LOCATION) # -------------------------------------------- cat >input.y <<'_ATEOF' %define api.prefix {foo} %name-prefix "bar" %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2541: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-deprecated input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-deprecated input.y" "input.at:2541" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-deprecated 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-24: 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:2541" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2542: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -p bar -Wno-deprecated input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -p bar -Wno-deprecated input.y" "input.at:2542" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -p bar -Wno-deprecated input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: 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:2542" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %name-prefix "bar" %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2543: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -Wno-deprecated input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -Wno-deprecated input.y" "input.at:2543" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -Wno-deprecated input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo ":3: 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:2543" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.prefix {foo} %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2544: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -p bar -Wno-deprecated input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -p bar -Wno-deprecated input.y" "input.at:2544" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -p bar -Wno-deprecated 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-24: 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:2544" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2555' \ "Redefined %union name" " " 1 at_xfail=no ( $as_echo "57. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST(DIRECTIVES, EXIT-STATUS, ERROR) # --------------------------------------- cat >input.y <<'_ATEOF' %union foo {}; %union {}; %union foo {}; %define api.value.union.name foo %% exp: %empty; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2580: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2580" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2580: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2580" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2580: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2580" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2580" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2580: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2580" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2580" $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:2580: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:2580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.8-10: warning: %define variable 'api.value.union.name' redefined [-Wother] input.y:1.8-10: previous definition input.y:4.1-32: warning: %define variable 'api.value.union.name' redefined [-Wother] input.y:3.8-10: previous definition input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2580" $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:2580: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:2580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2580" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:3.8-10: warning: %define variable 'api.value.union.name' redefined [-Wother] input.y:1.8-10: previous definition input.y:4.1-32: warning: %define variable 'api.value.union.name' redefined [-Wother] input.y:3.8-10: previous definition input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2580: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2580" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2580" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2580: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:2580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2580" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2580: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:2580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2580" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2580: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:2580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2580" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi cat >input.y <<'_ATEOF' %define api.value.union.name {foo} %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2585: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2585" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-34: error: %define variable 'api.value.union.name' requires keyword values input.y:1.1-34: error: %define variable 'api.value.union.name' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2585" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %define api.value.union.name "foo" %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/input.at:2590: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2590" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:1.1-34: error: %define variable 'api.value.union.name' requires keyword values input.y:1.1-34: error: %define variable 'api.value.union.name' is not used " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2590" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2602' \ "Stray \$ or @" " " 1 at_xfail=no ( $as_echo "58. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %type exp %token TOK TOK2 %destructor { $%; @%; } <*> exp TOK; %initial-action { $%; @%; }; %printer { $%; @%; } <*> exp TOK; %{ $ @ %} // Should not warn. %% exp: TOK { $%; @%; $$ = $1; } | 'a' { $<->1; $$ = 1; } | 'b' { $bar>$; } %% $ @ // Should not warn. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2633: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2633" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2633" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2633: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" "input.at:2633" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2633" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2633: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2633" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2633" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2633: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2633" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2633" $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:2633: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall input.y" at_fn_check_prepare_trace "input.at:2633" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:11.19: warning: stray '\$' [-Wother] input.y:11.23: warning: stray '@' [-Wother] input.y:12.19: warning: stray '\$' [-Wother] input.y:12.23: warning: stray '@' [-Wother] input.y:13.19: warning: stray '\$' [-Wother] input.y:13.23: warning: stray '@' [-Wother] input.y:16.19: warning: stray '\$' [-Wother] input.y:16.23: warning: stray '@' [-Wother] input.y:17.19: warning: stray '\$' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2633" $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:2633: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror" "input.at:2633" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2633" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:11.19: warning: stray '$' [-Wother] input.y:11.23: warning: stray '@' [-Wother] input.y:12.19: warning: stray '$' [-Wother] input.y:12.23: warning: stray '@' [-Wother] input.y:13.19: warning: stray '$' [-Wother] input.y:13.23: warning: stray '@' [-Wother] input.y:16.19: warning: stray '$' [-Wother] input.y:16.23: warning: stray '@' [-Wother] input.y:17.19: warning: stray '$' [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2633: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2633" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2633" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2633: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error" "input.at:2633" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2633" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2633: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none" "input.at:2633" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2633" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2633: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none" "input.at:2633" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2633" $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_58 #AT_START_59 at_fn_group_banner 59 'input.at:2645' \ "Code injection" " " 1 at_xfail=no ( $as_echo "59. $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 %token b %initial-action { $$; $$ }; %printer { $$ $$ } <> <*>; %lex-param { m4_errprintn(DEAD %lex-param) }; %parse-param { m4_errprintn(DEAD %parse-param) }; %% exp: a a[name] b { $$; $1; $$ $1 $name $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:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2697" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d input.y" "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $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:2697: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d input.y" at_fn_check_prepare_trace "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $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:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -S glr.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2697" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.c input.y" "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $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:2697: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S glr.c input.y" at_fn_check_prepare_trace "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $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:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -S lalr1.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2697" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc input.y" "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $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:2697: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S lalr1.cc input.y" at_fn_check_prepare_trace "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $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:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -S glr.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2697" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.cc input.y" "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $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:2697: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S glr.cc input.y" at_fn_check_prepare_trace "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $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:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -S lalr1.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2697" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2697: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S lalr1.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S lalr1.java input.y" "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2697: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2697" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2697" $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:2697: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -S lalr1.java input.y" at_fn_check_prepare_trace "input.at:2697" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2697" $at_failed && at_fn_log_failure $at_traceon; } cat >input.y <<'_ATEOF' %type <]m4_errprintn(DEAD %type)> exp %token <]m4_errprintn(DEAD %token)> a %token b %initial-action { $$; $<]m4_errprintn(DEAD %initial-action)>$ }; %printer { $$ $<]m4_errprintn(DEAD %printer)>$ } <> <*>; %lex-param { ]m4_errprintn(DEAD %lex-param) }; %parse-param { ]m4_errprintn(DEAD %parse-param) }; %% exp: a a[name] b { $$; $1; $<]m4_errprintn(DEAD action 1)>$ $<]m4_errprintn(DEAD action 2)>1 $<]m4_errprintn(DEAD action 3)>name $<]m4_errprintn(DEAD action 4)>0 ; }; _ATEOF # FIXME: Provide a means to iterate over all the skeletons. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2698" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d input.y" "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $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:2698: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d input.y" at_fn_check_prepare_trace "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $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:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -S glr.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2698" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.c input.y" "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $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:2698: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S glr.c input.y" at_fn_check_prepare_trace "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S glr.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $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:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -S lalr1.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2698" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc input.y" "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $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:2698: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S lalr1.cc input.y" at_fn_check_prepare_trace "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S lalr1.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $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:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -S glr.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2698" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.cc input.y" "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $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:2698: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S glr.cc input.y" at_fn_check_prepare_trace "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -S glr.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $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:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -S lalr1.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2698" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2698: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S lalr1.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S lalr1.java input.y" "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2698: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2698" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2698" $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:2698: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -S lalr1.java input.y" at_fn_check_prepare_trace "input.at:2698" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -S lalr1.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2698" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2709' \ "Deprecated directives" " " 1 at_xfail=no ( $as_echo "60. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %default_prec %error_verbose %expect_rr 0 %file-prefix = "foo" %file-prefix = "bar" %fixed-output_files %fixed_output-files %fixed-output-files %name-prefix= "foo" %no-default_prec %no_default-prec %no_lines %output = "output.c" %pure_parser %token_table %error-verbose %glr-parser %name-prefix "bar" %% exp : '0' _ATEOF cat >errors-all <<'_ATEOF' input.y:10.1-13: warning: deprecated directive: '%default_prec', use '%default-prec' [-Wdeprecated] fix-it:"input.y":{10:1-10:14}:"%default-prec" input.y:11.1-14: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated] fix-it:"input.y":{11:1-11:15}:"%define parse.error verbose" input.y:12.1-10: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated] fix-it:"input.y":{12:1-12:11}:"%expect-rr" input.y:13.1-14: warning: deprecated directive: '%file-prefix =', use '%file-prefix' [-Wdeprecated] fix-it:"input.y":{13:1-13:15}:"%file-prefix" input.y:14.1-16.5: warning: duplicate directive: '%file-prefix\n =' [-Wother] input.y:13.1-20: previous declaration fix-it:"input.y":{14:1-16:6}:"" input.y:17.9-27: warning: deprecated directive: '%fixed-output_files', use '%output "y.tab.c"' [-Wdeprecated] fix-it:"input.y":{17:2-17:21}:"%output \"y.tab.c\"" input.y:18.9-27: warning: deprecated directive: '%fixed_output-files', use '%output "y.tab.c"' [-Wdeprecated] fix-it:"input.y":{18:9-18:28}:"%output \"y.tab.c\"" input.y:19.1-19: warning: deprecated directive: '%fixed-output-files', use '%output "y.tab.c"' [-Wdeprecated] fix-it:"input.y":{19:1-19:20}:"%output \"y.tab.c\"" input.y:20.1-19: warning: deprecated directive: '%name-prefix= "foo"', use '%define api.prefix {foo}' [-Wdeprecated] fix-it:"input.y":{20:1-20:20}:"%define api.prefix {foo}" input.y:21.1-16: warning: deprecated directive: '%no-default_prec', use '%no-default-prec' [-Wdeprecated] fix-it:"input.y":{21:1-21:17}:"%no-default-prec" input.y:22.1-16: warning: deprecated directive: '%no_default-prec', use '%no-default-prec' [-Wdeprecated] fix-it:"input.y":{22:1-22:17}:"%no-default-prec" input.y:23.1-9: warning: deprecated directive: '%no_lines', use '%no-lines' [-Wdeprecated] fix-it:"input.y":{23:1-23:10}:"%no-lines" input.y:24.1-9: warning: deprecated directive: '%output =', use '%output' [-Wdeprecated] fix-it:"input.y":{24:1-24:10}:"%output" input.y:25.1-12: warning: deprecated directive: '%pure_parser', use '%define api.pure' [-Wdeprecated] fix-it:"input.y":{25:1-25:13}:"%define api.pure" input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-table' [-Wdeprecated] fix-it:"input.y":{26:1-26:13}:"%token-table" input.y:27.1-14: warning: %define variable 'parse.error' redefined [-Wother] input.y:11.1-14: previous definition fix-it:"input.y":{27:1-27:15}:"" input.y:29.1-18: warning: duplicate directive: '%name-prefix "bar"' [-Wother] input.y:13.1-20: previous declaration fix-it:"input.y":{29:1-29:19}:"" input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF { set +x $as_echo "$at_srcdir/input.at:2781: cp errors-all experr" at_fn_check_prepare_trace "input.at:2781" ( $at_check_trace; cp errors-all experr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:2781" $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:2782: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -ffixit input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2782" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -ffixit input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2782" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2782: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -ffixit input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -ffixit input.y" "input.at:2782" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -ffixit input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2782" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2782: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2782" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2782" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2782: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2782" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2782" $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:2782: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -ffixit input.y" at_fn_check_prepare_trace "input.at:2782" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -ffixit 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 0 $at_status "$at_srcdir/input.at:2782" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2784: sed -e '/^fix-it:/d' errors-all >experr" at_fn_check_prepare_trace "input.at:2784" ( $at_check_trace; sed -e '/^fix-it:/d' errors-all >experr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:2784" $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:2785: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2785" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2785" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2785: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2785" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2785" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2785: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2785" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2785" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2785: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2785" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2785" $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:2785: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:2785" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret 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 0 $at_status "$at_srcdir/input.at:2785" $at_failed && at_fn_log_failure $at_traceon; } # Update the input file. Make sure we generated nothing. { set +x $as_echo "$at_srcdir/input.at:2789: rm -f output.c" at_fn_check_prepare_trace "input.at:2789" ( $at_check_trace; rm -f output.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/input.at:2789" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2790: cp input.y input.y.orig" at_fn_check_prepare_trace "input.at:2790" ( $at_check_trace; cp input.y input.y.orig ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:2790" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2791: sed -e '/fix-it/d' experr" at_fn_check_prepare_trace "input.at:2791" ( $at_check_trace; sed -e '/fix-it/d' experr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:2791" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2792: echo \"bison: file 'input.y' was updated (backup: 'input.y~')\" >>experr" at_fn_check_prepare_trace "input.at:2792" ( $at_check_trace; echo "bison: file 'input.y' was updated (backup: 'input.y~')" >>experr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:2792" $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:2793: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --update input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2793" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --update input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2793: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update input.y" "input.at:2793" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2793" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2793: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2793" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2793" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2793: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2793" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2793" $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:2793: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --update input.y" at_fn_check_prepare_trace "input.at:2793" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --update 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 0 $at_status "$at_srcdir/input.at:2793" $at_failed && at_fn_log_failure $at_traceon; } # Check the backup. { set +x $as_echo "$at_srcdir/input.at:2796: diff input.y.orig input.y~" at_fn_check_prepare_trace "input.at:2796" ( $at_check_trace; diff input.y.orig input.y~ ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:2796" $at_failed && at_fn_log_failure $at_traceon; } # Check we did not generate any file. { set +x $as_echo "$at_srcdir/input.at:2799: test ! -f output.c" at_fn_check_prepare_trace "input.at:2799" ( $at_check_trace; test ! -f output.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/input.at:2799" $at_failed && at_fn_log_failure $at_traceon; } # Check the update. { set +x $as_echo "$at_srcdir/input.at:2821: sed -e '1,8d' input.y" at_fn_check_prepare_trace "input.at:2821" ( $at_check_trace; sed -e '1,8d' input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " %default-prec %define parse.error verbose %expect-rr 0 %file-prefix \"foo\" %output \"y.tab.c\" %output \"y.tab.c\" %output \"y.tab.c\" %define api.prefix {foo} %no-default-prec %no-default-prec %no-lines %output \"output.c\" %define api.pure %token-table %glr-parser %% exp : '0' " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2821" $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:2823: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2823" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2823" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2823: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2823" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2823" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2823: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2823" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2823" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2823: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2823" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2823" $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:2823: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:2823" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2823" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2838' \ "Unput's effect on locations" " " 1 at_xfail=no ( $as_echo "61. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %glr-parser %expect_rr 42 %expect_rr 42 %expect_rr 42 %error_verbose %error_verbose %error_verbose %% exp: '0' _ATEOF { set +x $as_echo "$at_srcdir/input.at:2864: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2864" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:11.1-10: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated] input.y:11.15-24: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated] input.y:12.15-24: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated] input.y:13.1-14: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated] input.y:13.16-29: warning: %define variable 'parse.error' redefined [-Wother] input.y:13.1-14: previous definition input.y:14.16-29: warning: %define variable 'parse.error' redefined [-Wother] input.y:13.16-29: previous definition input.y: error: reduce/reduce conflicts: 0 found, 42 expected input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2864" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'input.at:2874' \ "Non-deprecated directives" " " 1 at_xfail=no ( $as_echo "62. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %default-prec %define parse.error verbose %expect-rr 42 %file-prefix "foo" %file-prefix "bar" %no-default-prec %no-lines %output "foo" %token-table %% exp : '0' _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/input.at:2899: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2899" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:2899" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2899: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2899" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2899" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2899: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2899" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2899" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2899: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2899" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2899" $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:2899: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "input.at:2899" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:14.1-15.5: warning: duplicate directive: '%file-prefix' [-Wother] input.y:13.1-18: previous declaration input.y: warning: %expect-rr applies only to GLR parsers [-Wother] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2899" $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:2899: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:2899" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2899" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:14.1-15.5: warning: duplicate directive: '%file-prefix' [-Wother] input.y:13.1-18: previous declaration input.y: warning: %expect-rr applies only to GLR parsers [-Wother] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2899: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2899" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2899" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2899: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:2899" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2899" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2899: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:2899" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2899" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2899: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:2899" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2899" $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_62 #AT_START_63 at_fn_group_banner 63 'input.at:2909' \ "Cannot type action" " " 1 at_xfail=no ( $as_echo "63. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% 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/input.at:2921: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "input.at:2921" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2921" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2921: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:2921" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/input.at:2921" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/input.at:2921: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2921" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2921" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/input.at:2921: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2921" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2921" $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:2921: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "input.at:2921" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:10.6-13: warning: only midrule actions can be typed: int [-Wother] 10 | exp: {} | ^~~~~~~~ " | \ $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:2921" $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:2921: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:2921" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2921" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:10.6-13: warning: only midrule actions can be typed: int [-Wother] 10 | exp: {} | ^~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/input.at:2921: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2921" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/input.at:2921" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/input.at:2921: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:2921" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/input.at:2921" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/input.at:2921: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:2921" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2921" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/input.at:2921: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:2921" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2921" $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_63 #AT_START_64 at_fn_group_banner 64 'input.at:2932' \ "Character literals and api.token.raw" " " 1 at_xfail=no ( $as_echo "64. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.token.raw %token 'a' %% exp: 'b' "c" {} _ATEOF { set +x $as_echo "$at_srcdir/input.at:2955: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2955" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:10.8-10: error: character literals cannot be used together with api.token.raw 10 | %token 'a' | ^~~ input.y:9.1-21: definition of api.token.raw 9 | %define api.token.raw | ^~~~~~~~~~~~~~~~~~~~~ input.y:12.6-8: error: character literals cannot be used together with api.token.raw 12 | exp: 'b' \"c\" {} | ^~~ input.y:9.1-21: definition of api.token.raw 9 | %define api.token.raw | ^~~~~~~~~~~~~~~~~~~~~ " | \ $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:2955" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'named-refs.at:22' \ "Tutorial calculator" " " 2 at_xfail=no ( $as_echo "65. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ %% input: line | input line {} ; line: '\n' | exp '\n' {} ; exp: NUM { $$ = $NUM; } | exp[l] '=' exp[r] { if ($l != $r) fprintf (stderr, "calc: error: %d != %d\n", $l, $r); $$ = $l; } | exp[x] '+' { $$ = $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; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int get_char (void) { return getc (input); } static void unget_char (int c) { ungetc (c, input); } static int read_signed_integer (void) { int c = get_char (); int sign = 1; int n = 0; if (c == '-') { c = get_char (); sign = -1; } while (isdigit (c)) { n = 10 * n + (c - '0'); c = get_char (); } unget_char ( c); return sign * n; } static int yylex (void) { int c; /* Skip white space. */ while ((c = get_char ()) == ' ' || c == '\t') {} /* process numbers */ if (c == '.' || isdigit (c)) { unget_char ( c); (yylval).ival = read_signed_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } static int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); fclose (input); assert (global_result == result); (void) global_result; (void) result; assert (global_count == count); (void) global_count; (void) count; return status; } _ATEOF cat >input.txt <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/named-refs.at:184: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/named-refs.at:184: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/named-refs.at:184: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "named-refs.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "named-refs.at:184" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/named-refs.at:184" { set +x $as_echo "$at_srcdir/named-refs.at:184: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "named-refs.at:184" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:185: \$PREPARSER ./test input.txt" at_fn_check_prepare_dynamic " $PREPARSER ./test input.txt" "named-refs.at:185" ( $at_check_trace; $PREPARSER ./test input.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:185" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:185: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "named-refs.at:185" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:185" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_65 #AT_START_66 at_fn_group_banner 66 'named-refs.at:196' \ "Undefined and ambiguous references" " " 2 at_xfail=no ( $as_echo "66. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ static int power (int base, int exponent); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ %% input: line | input line {} ; line: '\n' | exp '\n' {} ; exp: NUM { $$ = $NUM; } | exp[l] '=' exp[r] { if ($l != $r) fprintf (stderr, "calc: error: %d != %d\n", $l, $r); $$ = $l; } | exp[x] '+' { $$ = $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:288: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y" "named-refs.at:288" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:52.51-60: error: invalid reference: '\$lo9' 52 | | exp[x] '+' { \$\$ = \$x; } [l] exp[r] { \$\$ = \$lo9 + \$r; } | ^~~~~~~~~~ test.y:52.3-68: symbol not found in production: lo9 52 | | exp[x] '+' { \$\$ = \$x; } [l] exp[r] { \$\$ = \$lo9 + \$r; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test.y:53.51-60: warning: misleading reference: '\$exp' [-Wother] 53 | | exp[x] '-' { \$\$ = \$x; } [l] exp[r] { \$\$ = \$exp - \$r; } | ^~~~~~~~~~ test.y:44.1-3: refers to: \$exp at \$\$ 44 | exp: | ^~~ test.y:53.7: possibly meant: \$x, hiding \$exp at \$1 53 | | exp[x] '-' { \$\$ = \$x; } [l] exp[r] { \$\$ = \$exp - \$r; } | ^ test.y:53.41: possibly meant: \$r, hiding \$exp at \$4 53 | | exp[x] '-' { \$\$ = \$x; } [l] exp[r] { \$\$ = \$exp - \$r; } | ^ test.y:54.51-52: error: \$l of 'exp' has no declared type 54 | | exp[x] '*' { \$\$ = \$x; } [l] exp[r] { \$\$ = \$l * \$r; } | ^~ test.y:57.40-43: error: invalid reference: '\$r12' 57 | | exp[l] '^' exp[r] { \$\$ = power (\$l, \$r12); } | ^~~~ test.y:57.3-47: symbol not found in production: r12 57 | | exp[l] '^' exp[r] { \$\$ = power (\$l, \$r12); } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test.y:58.29-33: error: invalid reference: '\$expo' 58 | | '(' exp ')' { \$\$ = \$expo; } | ^~~~~ test.y:58.3-46: symbol not found in production: expo 58 | | '(' exp ')' { \$\$ = \$expo; } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:288" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'named-refs.at:297' \ "Misleading references" " " 2 at_xfail=no ( $as_echo "67. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% 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:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:310" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:310" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/named-refs.at:310: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:310" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:310" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/named-refs.at:310: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:310" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:310" $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:310: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "named-refs.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.22-29: warning: misleading reference: '\$foo.bar' [-Wother] test.y:11.8-10: refers to: \$foo at \$1 test.y:11.12-18: possibly meant: \$[foo.bar] at \$2 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:310" $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:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Werror" "named-refs.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:310" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' test.y:11.22-29: warning: misleading reference: '$foo.bar' [-Wother] test.y:11.8-10: refers to: $foo at $1 test.y:11.12-18: possibly meant: $[foo.bar] at $2 _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/named-refs.at:310: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "named-refs.at:310" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:310" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/named-refs.at:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=error" "named-refs.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:310" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/named-refs.at:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Wnone,none -Werror --trace=none" "named-refs.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:310" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=none -Werror --trace=none" "named-refs.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:310" $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_67 #AT_START_68 at_fn_group_banner 68 'named-refs.at:316' \ "Many kinds of errors" " " 2 at_xfail=no ( $as_echo "68. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:424: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:424" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1' test.y:23.11-24.62: symbol not found in production: cond1 test.y:26.43-53: error: invalid reference: '\$stmt.field' test.y:25.11-26.60: symbol not found in production: stmt test.y:25.35-38: possibly meant: \$then.field, hiding \$stmt.field at \$4 test.y:28.43-52: error: invalid reference: '\$stmt.list' test.y:27.11-28.59: symbol not found in production: stmt test.y:27.30-38: possibly meant: \$[stmt.list] at \$4 test.y:30.43-46: error: ambiguous reference: '\$xyz' test.y:29.35-37: refers to: \$xyz at \$4 test.y:29.50-52: refers to: \$xyz at \$6 test.y:32.43-52: error: invalid reference: '\$stmt.list' test.y:31.11-32.63: symbol not found in production: stmt test.y:31.40-43: possibly meant: \$then, hiding \$[stmt.list] at \$4 test.y:31.61-64: possibly meant: \$else, hiding \$[stmt.list] at \$6 test.y:34.43-58: error: invalid reference: '\$stmt.list.field' test.y:33.11-34.69: symbol not found in production: stmt test.y:33.40-43: possibly meant: \$then.field, hiding \$[stmt.list].field at \$4 test.y:33.61-64: possibly meant: \$else.field, hiding \$[stmt.list].field at \$6 test.y:36.43-54: error: invalid reference: '\$[stmt.list]' test.y:35.11-36.71: symbol not found in production: stmt.list test.y:35.40-43: possibly meant: \$then, hiding \$[stmt.list] at \$4 test.y:35.61-64: possibly meant: \$else, hiding \$[stmt.list] at \$6 test.y:38.43-49: error: invalid reference: '\$then.1' test.y:37.11-38.60: symbol not found in production: then test.y:37.40-45: possibly meant: \$[then.1] at \$4 test.y:40.43-55: error: invalid reference: '\$then.1.field' test.y:39.11-40.66: symbol not found in production: then test.y:39.40-45: possibly meant: \$[then.1].field at \$4 test.y:42.44-50: error: invalid reference: '\$stmt.x' test.y:41.12-42.57: symbol not found in production: stmt test.y:41.36-41: possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4 test.y:41.36-41: possibly meant: \$[stmt.x] at \$4 test.y:44.13-22: error: invalid reference: '\$if-stmt-a' test.y:43.12-44.59: symbol not found in production: if test.y:43.1-9: possibly meant: \$[if-stmt-a] at \$\$ test.y:46.46-54: error: invalid reference: '\$then-a.f' test.y:45.12-46.65: symbol not found in production: then test.y:45.41-46: possibly meant: \$[then-a].f at \$4 " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:424" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:544: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y" "named-refs.at:544" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:24.36-41: error: invalid reference: '\$cond1' 24 | { \$if_stmt1 = new IfStmt(\$cond1, \$then.f1, \$else); }; | ^~~~~~ test.y:23.11-24.62: symbol not found in production: cond1 23 | if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test.y:26.43-53: error: invalid reference: '\$stmt.field' 26 | { \$if_stmt2 = new IfStmt(\$cond, \$stmt.field, 0); }; | ^~~~~~~~~~~ test.y:25.11-26.60: symbol not found in production: stmt 25 | if_stmt2: IF expr[cond] THEN stmt[then] FI | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test.y:25.35-38: possibly meant: \$then.field, hiding \$stmt.field at \$4 25 | if_stmt2: IF expr[cond] THEN stmt[then] FI | ^~~~ test.y:28.43-52: error: invalid reference: '\$stmt.list' 28 | { \$if_stmt3 = new IfStmt(\$cond, \$stmt.list, 0); }; | ^~~~~~~~~~ test.y:27.11-28.59: symbol not found in production: stmt 27 | if_stmt3: IF expr[cond] THEN stmt.list FI | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ test.y:27.30-38: possibly meant: \$[stmt.list] at \$4 27 | if_stmt3: IF expr[cond] THEN stmt.list FI | ^~~~~~~~~ test.y:30.43-46: error: ambiguous reference: '\$xyz' 30 | { \$if_stmt4 = new IfStmt(\$cond, \$xyz, \$cond); }; | ^~~~ test.y:29.35-37: refers to: \$xyz at \$4 29 | if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI | ^~~ test.y:29.50-52: refers to: \$xyz at \$6 29 | if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI | ^~~ test.y:32.43-52: error: invalid reference: '\$stmt.list' 32 | { \$if_stmt5 = new IfStmt(\$cond, \$stmt.list, \$else); }; | ^~~~~~~~~~ test.y:31.11-32.63: symbol not found in production: stmt 31 | 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 31 | 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 31 | 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' 34 | { \$if_stmt6 = new IfStmt(\$cond, \$stmt.list.field, \$else); }; | ^~~~~~~~~~~~~~~~ test.y:33.11-34.69: symbol not found in production: stmt 33 | 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 33 | 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 33 | if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI | ^~~~ test.y:36.43-54: error: invalid reference: '\$[stmt.list]' 36 | { \$if_stmt7 = new IfStmt(\$cond, \$[stmt.list].field, \$else); }; | ^~~~~~~~~~~~ test.y:35.11-36.71: symbol not found in production: stmt.list 35 | 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 35 | 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 35 | if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI | ^~~~ test.y:38.43-49: error: invalid reference: '\$then.1' 38 | { \$if_stmt8 = new IfStmt(\$cond, \$then.1, \$else); }; | ^~~~~~~ test.y:37.11-38.60: symbol not found in production: then 37 | 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 37 | 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' 40 | { \$if_stmt9 = new IfStmt(\$cond, \$then.1.field, \$else); }; | ^~~~~~~~~~~~~ test.y:39.11-40.66: symbol not found in production: then 39 | 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 39 | 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' 42 | { \$if_stmt10 = new IfStmt(\$cond, \$stmt.x, 0); }; | ^~~~~~~ test.y:41.12-42.57: symbol not found in production: stmt 41 | 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 41 | if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI | ^~~~~~ test.y:41.36-41: possibly meant: \$[stmt.x] at \$4 41 | if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI | ^~~~~~ test.y:44.13-22: error: invalid reference: '\$if-stmt-a' 44 | { \$if-stmt-a = new IfStmt(\$cond, \$then, \$else); }; | ^~~~~~~~~~ test.y:43.12-44.59: symbol not found in production: if 43 | 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 \$\$ 43 | 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' 46 | { \$[if-stmt-b] = new IfStmt(\$cond, \$then-a.f, \$else); }; | ^~~~~~~~~ test.y:45.12-46.65: symbol not found in production: then 45 | 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 45 | 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:544" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'named-refs.at:551' \ "Missing identifiers in brackets" " " 2 at_xfail=no ( $as_echo "69. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% start: foo[] bar { s = $foo; } _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:561: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:561" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.12: error: an identifier expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at: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_69 #AT_START_70 at_fn_group_banner 70 'named-refs.at:567' \ "Redundant words in brackets" " " 2 at_xfail=no ( $as_echo "70. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% start: foo[ a d ] bar { s = $foo; } _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:577: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:577" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.15: error: unexpected identifier in bracketed name: 'd' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:577" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'named-refs.at:583' \ "Comments in brackets" " " 2 at_xfail=no ( $as_echo "71. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% start: foo[/* comment */] bar { s = $foo; } _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:593: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:593" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.25: error: an identifier expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:593" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'named-refs.at:599' \ "Stray symbols in brackets" " " 2 at_xfail=no ( $as_echo "72. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% start: foo[ % /* aaa */ *&-.+\000\001\002\377 ] bar { s = $foo; } _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:607: \"\$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:607" ( $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:607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:612: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:612" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.13: error: invalid character in bracketed name: '%' test.y:11.25-27: error: invalid characters in bracketed name: '*&-' test.y:11.29-30: error: invalid characters in bracketed name: '+\\0\\001\\002\\377' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at: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_72 #AT_START_73 at_fn_group_banner 73 'named-refs.at:618' \ "Redundant words in LHS brackets" " " 2 at_xfail=no ( $as_echo "73. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% start[a s]: foo; _ATEOF { set +x $as_echo "$at_srcdir/named-refs.at:627: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:627" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:11.9: error: unexpected identifier in bracketed name: 's' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:627" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_73 #AT_START_74 at_fn_group_banner 74 'named-refs.at:635' \ "Factored LHS" " " 2 at_xfail=no ( $as_echo "74. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% 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:642: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:642" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:642: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:642" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:642" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/named-refs.at:642: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:642" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:642" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/named-refs.at:642: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:642" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/named-refs.at:642: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "named-refs.at:642" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at: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_74 #AT_START_75 at_fn_group_banner 75 'named-refs.at:648' \ "Unresolved references" " " 2 at_xfail=no ( $as_echo "75. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% 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:709: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:709" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:12.22-31: error: invalid reference: '\$sym.field' test.y:12.3-35: symbol not found in production: sym test.y:13.22-35: error: invalid reference: '\$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: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_75 #AT_START_76 at_fn_group_banner 76 'named-refs.at:715' \ "\$ or @ followed by . or -" " " 2 at_xfail=no ( $as_echo "76. $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:731: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y" "named-refs.at:731" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:4.12-18: error: invalid reference: '\$.field' test.y:4.13: syntax error after '\$', expecting integer, letter, '_', '[', or '\$' test.y:4.3-8: possibly meant: \$[.field] at \$1 test.y:5.12-18: error: invalid reference: '@.field' test.y:5.13: syntax error after '@', expecting integer, letter, '_', '[', or '\$' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:731" $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:743: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv test.y" at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:743" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:743" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:743: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml test.y" "named-refs.at:743" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:743" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/named-refs.at:743: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:743" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:743" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/named-refs.at:743: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:743" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:743" $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:743: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret test.y" at_fn_check_prepare_trace "named-refs.at:743" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "test.y:4.9: warning: stray '\$' [-Wother] test.y:5.9: warning: stray '@' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:743" $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:743: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Werror" "named-refs.at:743" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:743" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' test.y:4.9: warning: stray '$' [-Wother] test.y:5.9: warning: stray '@' [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/named-refs.at:743: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "named-refs.at:743" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:743" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/named-refs.at:743: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=error" "named-refs.at:743" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:743" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/named-refs.at:743: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Wnone,none -Werror --trace=none" "named-refs.at:743" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:743" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/named-refs.at:743: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=none -Werror --trace=none" "named-refs.at:743" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:743" $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_76 #AT_START_77 at_fn_group_banner 77 'output.at:66' \ "Output files: -dv" " " 3 at_xfail=no ( $as_echo "77. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:66: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:66" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:66" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:66: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:66" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:66" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:66: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:66" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:66" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:66: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv foo.y" "output.at:66" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:66" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:66: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:66" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:66" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:66: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:66" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:66" $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:66: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv foo.y" at_fn_check_prepare_trace "output.at:66" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:66" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:66: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:66" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.c foo.tab.h " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:66" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:74' \ "Output files: -dv >&-" " " 3 at_xfail=no ( $as_echo "78. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/output.at:74: case \"\$PREBISON\" in *valgrind*) exit 77;; esac" at_fn_check_prepare_dynamic "case \"$PREBISON\" in *valgrind*) exit 77;; esac" "output.at:74" ( $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:74" $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:74: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:74" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:74" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:74: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:74" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:74" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:74: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv >&- foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:74" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:74" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:74: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv >&- foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv >&- foo.y" "output.at:74" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv >&- foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:74" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:74: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:74" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:74" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:74: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:74" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:74" $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:74: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv >&- foo.y" at_fn_check_prepare_trace "output.at:74" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv >&- foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:74" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:74: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:74" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.c foo.tab.h " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at: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_78 #AT_START_79 at_fn_group_banner 79 'output.at:77' \ "Output files: -dv -o foo.c" " " 3 at_xfail=no ( $as_echo "79. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:77: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:77" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:77" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:77: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:77" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:77" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:77: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv -o foo.c foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:77" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:77" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:77: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.c foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.c foo.y" "output.at:77" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:77" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:77: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:77" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:77" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:77: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:77" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:77" $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:77: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -o foo.c foo.y" at_fn_check_prepare_trace "output.at:77" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:77" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:77: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:77" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.c foo.h foo.output " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:77" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:79' \ "Output files: -dv -o foo.tab.c" " " 3 at_xfail=no ( $as_echo "80. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:79: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:79" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:79" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:79: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:79" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:79" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:79: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv -o foo.tab.c foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:79" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:79" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:79: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y" "output.at:79" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:79" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:79: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:79" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:79" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:79: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:79" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:79: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -o foo.tab.c foo.y" at_fn_check_prepare_trace "output.at:79" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -o foo.tab.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:79" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:79: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:79" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.c foo.tab.h " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at: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_80 #AT_START_81 at_fn_group_banner 81 'output.at:82' \ "Output files: -dv -g --xml --fixed-output-files" "" 3 at_xfail=no ( $as_echo "81. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y y.dot y.output y.tab.c y.tab.h y.xml; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:82: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:82" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:82" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:82: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:82" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:82" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:82: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv -g --xml --fixed-output-files foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:82" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -dv -g --xml --fixed-output-files 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:82" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:82: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml --fixed-output-files foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml --fixed-output-files foo.y" "output.at:82" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml --fixed-output-files 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:82" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:82: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:82" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:82" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:82: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:82" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:82" $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:82: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g --xml --fixed-output-files foo.y" at_fn_check_prepare_trace "output.at:82" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g --xml --fixed-output-files foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:82" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:82: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:82" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "y.dot y.output y.tab.c y.tab.h y.xml " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:82" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:84' \ "Output files: -dv -g --xml -y" " " 3 at_xfail=no ( $as_echo "82. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y y.dot y.output y.tab.c y.tab.h y.xml; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:84: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:84" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:84" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:84: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:84" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:84" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:84: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv -g --xml -y foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:84" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -dv -g --xml -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:84" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:84: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y" "output.at:84" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:84" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:84: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:84" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:84" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:84: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:84" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:84" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:84: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g --xml -y foo.y" at_fn_check_prepare_trace "output.at:84" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g --xml -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:84" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:84: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:84" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "y.dot y.output y.tab.c y.tab.h y.xml " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:84" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_82 #AT_START_83 at_fn_group_banner 83 'output.at:86' \ "Output files: %require \"3.4\" -dv -g --xml -y" " " 3 at_xfail=no ( $as_echo "83. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y y.gv y.output y.tab.c y.tab.h y.xml; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.y <<'_ATEOF' %require "3.4" %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:86: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:86" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:86" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:86: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:86" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:86" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:86: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv -g --xml -y foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:86" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -dv -g --xml -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:86" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:86: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y" "output.at:86" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:86" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:86: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:86" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:86" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:86: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:86" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:86" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:86: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g --xml -y foo.y" at_fn_check_prepare_trace "output.at:86" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g --xml -y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:86" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:86: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:86" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "y.gv y.output y.tab.c y.tab.h y.xml " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:86" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_83 #AT_START_84 at_fn_group_banner 84 'output.at:89' \ "Output files: -dv -g --xml -o y.tab.c" " " 3 at_xfail=no ( $as_echo "84. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y y.dot y.output y.tab.c y.tab.h y.xml; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.y <<'_ATEOF' %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:89: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:89" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:89" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:89: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:89" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:89" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:89: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv -g --xml -o y.tab.c foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -dv -g --xml -o y.tab.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:89" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:89: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -o y.tab.c foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -o y.tab.c foo.y" "output.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -o y.tab.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:89" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:89: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:89" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:89" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:89: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:89" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:89" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:89: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g --xml -o y.tab.c foo.y" at_fn_check_prepare_trace "output.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g --xml -o y.tab.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:89" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:89: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:89" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "y.dot y.output y.tab.c y.tab.h y.xml " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:89" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_84 #AT_START_85 at_fn_group_banner 85 'output.at:92' \ "Output files: -dv -b bar" " " 3 at_xfail=no ( $as_echo "85. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:92: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:92" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:92" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:92: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:92" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:92" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:92: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv -b bar foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:92" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:92: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -b bar foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -b bar foo.y" "output.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -b bar foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:92" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:92: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:92" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:92" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:92: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:92" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:92" $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:92: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -b bar foo.y" at_fn_check_prepare_trace "output.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -b bar foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:92" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:92: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:92" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "bar.output bar.tab.c bar.tab.h " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at: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_85 #AT_START_86 at_fn_group_banner 86 'output.at:94' \ "Output files: -dv -g -o foo.c" " " 3 at_xfail=no ( $as_echo "86. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:94: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:94" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:94" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:94: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:94" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:94" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:94: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -dv -g -o foo.c foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:94" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:94" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:94: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g -o foo.c foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g -o foo.c foo.y" "output.at:94" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:94" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:94: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:94" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:94" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:94: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:94" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:94" $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:94: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g -o foo.c foo.y" at_fn_check_prepare_trace "output.at:94" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -dv -g -o foo.c foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:94" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:94: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:94" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.c foo.dot foo.h foo.output " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at: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_86 #AT_START_87 at_fn_group_banner 87 'output.at:98' \ "Output files: %defines %verbose " " " 3 at_xfail=no ( $as_echo "87. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:98: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:98" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:98" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:98: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:98" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:98" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:98: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:98" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:98" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:98: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:98" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:98" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:98: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:98" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:98" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:98: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:98" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:98" $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:98: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y" at_fn_check_prepare_trace "output.at:98" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:98" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:98: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:98" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.c foo.tab.h " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:98" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:100' \ "Output files: %defines %verbose %yacc " " " 3 at_xfail=no ( $as_echo "88. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:100: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:100" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:100" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:100: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:100" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:100" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:100: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:100" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:100" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:100: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:100" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:100" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:100: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:100" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:100" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:100: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:100" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:100" $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:100: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y" at_fn_check_prepare_trace "output.at:100" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:100" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:100: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:100" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "y.output y.tab.c y.tab.h " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:100" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:103' \ "Output files: %defines %verbose %yacc " " " 3 at_xfail=no ( $as_echo "89. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:103: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:103" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:103" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:103: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:103" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:103" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:103: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:103" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:103" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:103: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:103" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:103" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:103: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:103" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:103" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:103: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:103" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:103" $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:103: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:103" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:103" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:103: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:103" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "y.output y.tab.c y.tab.h " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at: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_89 #AT_START_90 at_fn_group_banner 90 'output.at:107' \ "Output files: %file-prefix \"bar\" %defines %verbose " "" 3 at_xfail=no ( $as_echo "90. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:107: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:107" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:107" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:107: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:107" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:107" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:107: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:107" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:107" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:107: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:107" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:107" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:107: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:107" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:107" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:107: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:107" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:107" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:107: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y" at_fn_check_prepare_trace "output.at:107" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:107" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:107: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:107" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "bar.output bar.tab.c bar.tab.h " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:107" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_90 #AT_START_91 at_fn_group_banner 91 'output.at:109' \ "Output files: %output \"bar.c\" %defines %verbose %yacc " "" 3 at_xfail=no ( $as_echo "91. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y bar.c bar.h bar.output; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.y <<'_ATEOF' %output "bar.c" %defines %verbose %yacc %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:109: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:109" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:109" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:109: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:109" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:109" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:109: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:109" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:109" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:109: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:109" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:109" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:109: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:109" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:109" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:109: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:109" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:109" $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:109: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y" at_fn_check_prepare_trace "output.at:109" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:109" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:109: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:109" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "bar.c bar.h bar.output " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:109" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_91 #AT_START_92 at_fn_group_banner 92 'output.at:113' \ "Output files: %file-prefix \"baz\" %output \"bar.c\" %defines %verbose %yacc " "" 3 at_xfail=no ( $as_echo "92. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y bar.c bar.h bar.output; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.y <<'_ATEOF' %file-prefix "baz" %output "bar.c" %defines %verbose %yacc %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:113: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:113" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:113" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:113: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:113" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:113" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:113: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:113" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:113" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:113: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:113" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:113" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:113: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:113" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:113" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:113: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:113" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:113: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y" at_fn_check_prepare_trace "output.at:113" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:113" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:113: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:113" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "bar.c bar.h bar.output " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:113" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_92 #AT_START_93 at_fn_group_banner 93 'output.at:118' \ "Output files: %defines %verbose " " " 3 at_xfail=no ( $as_echo "93. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:118: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:118" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:118" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:118: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:118" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:118" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:118: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:118" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:118" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:118: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:118" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:118" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:118: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:118" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:118" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:118: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:118" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:118" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:118: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:118" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:118" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:118: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:118" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.cc foo.tab.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:118" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_93 #AT_START_94 at_fn_group_banner 94 'output.at:121' \ "Output files: %defines %verbose -o foo.c" " " 3 at_xfail=no ( $as_echo "94. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:121: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:121" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:121" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:121: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:121" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:121" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:121: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o foo.c foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:121" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:121: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c foo.yy" "output.at:121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:121" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:121: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:121" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:121" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:121: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:121" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:121" $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:121: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o foo.c foo.yy" at_fn_check_prepare_trace "output.at:121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o foo.c foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:121" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:121: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:121" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.c foo.h foo.output " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:121" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_94 #AT_START_95 at_fn_group_banner 95 'output.at:125' \ "Output files: --defines=foo.hpp -o foo.c++" " " 3 at_xfail=no ( $as_echo "95. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:125: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:125" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:125" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:125: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:125" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:125" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:125: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --defines=foo.hpp -o foo.c++ foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:125" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:125" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:125: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy" "output.at:125" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=foo.hpp -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:125" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:125: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:125" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:125" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:125: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:125" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:125" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:125: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=foo.hpp -o foo.c++ foo.yy" at_fn_check_prepare_trace "output.at:125" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=foo.hpp -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:125" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:125: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:125" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.c++ foo.hpp " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:125" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_95 #AT_START_96 at_fn_group_banner 96 'output.at:129' \ "Output files: %defines \"foo.hpp\" -o foo.c++" " " 3 at_xfail=no ( $as_echo "96. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:129: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:129" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:129" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:129: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:129" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:129" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:129: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o foo.c++ foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:129" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:129" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:129: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" "output.at:129" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:129" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:129: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:129" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:129" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:129: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:129" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:129" $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:129: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o foo.c++ foo.yy" at_fn_check_prepare_trace "output.at:129" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:129" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:129: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:129" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.c++ foo.hpp " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:129" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_96 #AT_START_97 at_fn_group_banner 97 'output.at:133' \ "Output files: -o foo.c++ --graph=foo.gph" " " 3 at_xfail=no ( $as_echo "97. $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: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:133: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:133" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:133" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:133: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:133" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:133" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:133: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o foo.c++ foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:133" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:133" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:133: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" "output.at:133" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:133" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:133: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:133" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:133" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:133: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:133" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:133: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o foo.c++ --graph=foo.gph foo.yy" at_fn_check_prepare_trace "output.at:133" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o foo.c++ --graph=foo.gph foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:133" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:133: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:133" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.c++ foo.gph " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.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_97 #AT_START_98 at_fn_group_banner 98 'output.at:140' \ "Output files: %type useless --defines --graph --xml --report=all -Wall -Werror" "" 3 at_xfail=no ( $as_echo "98. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y foo.dot foo.output foo.xml; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.y <<'_ATEOF' %type useless %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:140: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:140" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:140" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:140: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:140" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:140" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/output.at:140: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y" "output.at:140" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:140" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:140: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:140" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.dot foo.output foo.xml " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.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_98 #AT_START_99 at_fn_group_banner 99 'output.at:147' \ "Output files: useless=--defines --graph --xml --report=all -Wall -Werror" "" 3 at_xfail=no ( $as_echo "99. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.y foo.dot foo.output foo.xml; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.y <<'_ATEOF' %define useless %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.y >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:147: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:147" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.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/output.at:147" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:147: rm -f foo.y.bak" at_fn_check_prepare_trace "output.at:147" ( $at_check_trace; rm -f foo.y.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:147" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/output.at:147: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y" "output.at:147" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines --graph --xml --report=all -Wall -Werror foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:147" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:147: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.y|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:147" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.y|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.dot foo.output foo.xml " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:147" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_99 #AT_START_100 at_fn_group_banner 100 'output.at:161' \ "Output files: lalr1.cc " " " 3 at_xfail=no ( $as_echo "100. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.tab.cc; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:161: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:161" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:161" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:161: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:161" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:161" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:161: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:161" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:161: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:161" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:161" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:161: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:161" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:161" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:161: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:161" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:161: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:161" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:161" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:161: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:161" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.tab.cc " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.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_100 #AT_START_101 at_fn_group_banner 101 'output.at:164' \ "Output files: lalr1.cc %verbose " " " 3 at_xfail=no ( $as_echo "101. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.output foo.tab.cc; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %verbose %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:164: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:164" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:164" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:164: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:164" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:164" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:164: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:164" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:164" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:164: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:164" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:164" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:164: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:164" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:164" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:164: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:164" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:164" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:164: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:164" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:164" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:164: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:164" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.cc " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:164" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_101 #AT_START_102 at_fn_group_banner 102 'output.at:167' \ "Output files: lalr1.cc %defines %verbose " " " 3 at_xfail=no ( $as_echo "102. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.output foo.tab.cc foo.tab.hh stack.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:167: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:167" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:167" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:167: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:167" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:167" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:167: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:167" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:167" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:167: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:167" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:167" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:167: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:167" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:167" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:167: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:167" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:167: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:167" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:167" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:167: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:167" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.cc foo.tab.hh stack.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at: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_102 #AT_START_103 at_fn_group_banner 103 'output.at:170' \ "Output files: lalr1.cc %verbose %locations " " " 3 at_xfail=no ( $as_echo "103. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.output foo.tab.cc; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %verbose %locations %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:170: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:170" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:170" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:170: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:170" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:170" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:170: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:170" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:170" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:170: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:170" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:170" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:170: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:170" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:170" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:170: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:170" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:170: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:170" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:170" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:170: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:170" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.cc " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:170" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_103 #AT_START_104 at_fn_group_banner 104 'output.at:173' \ "Output files: lalr1.cc %defines %verbose %locations " "" 3 at_xfail=no ( $as_echo "104. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.output foo.tab.cc foo.tab.hh location.hh position.hh stack.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %locations %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:173: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:173" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:173" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:173: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:173" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:173" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:173: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:173" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:173" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:173: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:173" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:173" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:173: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:173" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:173" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:173: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:173" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:173" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:173: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:173" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:173" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:173: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:173" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.cc foo.tab.hh location.hh position.hh stack.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at: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_104 #AT_START_105 at_fn_group_banner 105 'output.at:177' \ "Output files: lalr1.cc %defines %verbose " " " 3 at_xfail=no ( $as_echo "105. $at_setup_line: testing $at_desc ..." $at_traceon for file in subdir/foo.yy foo.output foo.tab.cc foo.tab.hh stack.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >subdir/foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' subdir/foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:177: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" subdir/foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" subdir/foo.yy || exit 77" "output.at:177" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" subdir/foo.yy || 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:177" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:177: rm -f subdir/foo.yy.bak" at_fn_check_prepare_trace "output.at:177" ( $at_check_trace; rm -f subdir/foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:177" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:177: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv subdir/foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:177" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:177" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:177: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml subdir/foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml subdir/foo.yy" "output.at:177" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:177" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:177: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:177" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:177" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:177: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:177" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:177: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret subdir/foo.yy" at_fn_check_prepare_trace "output.at:177" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:177" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:177: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(subdir/foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:177" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(subdir/foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.output foo.tab.cc foo.tab.hh stack.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:177" $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:177: grep 'include .subdir/' foo.tab.cc" at_fn_check_prepare_trace "output.at:177" ( $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:177" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:177: grep 'include .subdir/' foo.tab.hh" at_fn_check_prepare_trace "output.at:177" ( $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:177" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_105 #AT_START_106 at_fn_group_banner 106 'output.at:182' \ "Output files: lalr1.cc %defines %verbose %locations -o subdir/foo.cc" "" 3 at_xfail=no ( $as_echo "106. $at_setup_line: testing $at_desc ..." $at_traceon for file in subdir/foo.yy subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/position.hh subdir/stack.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >subdir/foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %locations %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' subdir/foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:182: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" subdir/foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" subdir/foo.yy || exit 77" "output.at:182" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" subdir/foo.yy || 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:182" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:182: rm -f subdir/foo.yy.bak" at_fn_check_prepare_trace "output.at:182" ( $at_check_trace; rm -f subdir/foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:182" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:182: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o subdir/foo.cc subdir/foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:182" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:182" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:182: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy" "output.at:182" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:182" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:182: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:182" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:182" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:182: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:182" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:182: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o subdir/foo.cc subdir/foo.yy" at_fn_check_prepare_trace "output.at:182" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o subdir/foo.cc subdir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:182" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:182: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(subdir/foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:182" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(subdir/foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/position.hh subdir/stack.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:182" $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:182: grep 'include .subdir/' subdir/foo.cc" at_fn_check_prepare_trace "output.at:182" ( $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:182" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:182: grep 'include .subdir/' subdir/foo.hh" at_fn_check_prepare_trace "output.at:182" ( $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: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_106 #AT_START_107 at_fn_group_banner 107 'output.at:187' \ "Output files: lalr1.cc %defines %verbose %file-prefix \"output_dir/foo\" " "" 3 at_xfail=no ( $as_echo "107. $at_setup_line: testing $at_desc ..." $at_traceon for file in gram_dir/foo.yy output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/stack.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >gram_dir/foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %verbose %file-prefix "output_dir/foo" %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' gram_dir/foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:187: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" gram_dir/foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" gram_dir/foo.yy || exit 77" "output.at:187" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" gram_dir/foo.yy || 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:187" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:187: rm -f gram_dir/foo.yy.bak" at_fn_check_prepare_trace "output.at:187" ( $at_check_trace; rm -f gram_dir/foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:187" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:187: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv gram_dir/foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:187" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:187" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:187: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy" "output.at:187" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:187" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:187: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:187" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:187" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:187: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:187" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:187" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:187: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret gram_dir/foo.yy" at_fn_check_prepare_trace "output.at:187" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret gram_dir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:187" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:187: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(gram_dir/foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:187" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(gram_dir/foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/stack.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:187" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_107 #AT_START_108 at_fn_group_banner 108 'output.at:192' \ "Output files: lalr1.cc %defines %locations %verbose %file-prefix \"output_dir/foo\" " "" 3 at_xfail=no ( $as_echo "108. $at_setup_line: testing $at_desc ..." $at_traceon for file in gram_dir/foo.yy output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/location.hh output_dir/position.hh output_dir/stack.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >gram_dir/foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %locations %verbose %file-prefix "output_dir/foo" %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' gram_dir/foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:192: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" gram_dir/foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" gram_dir/foo.yy || exit 77" "output.at:192" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" gram_dir/foo.yy || 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:192" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:192: rm -f gram_dir/foo.yy.bak" at_fn_check_prepare_trace "output.at:192" ( $at_check_trace; rm -f gram_dir/foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:192" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:192: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv gram_dir/foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:192" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:192" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:192: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy" "output.at:192" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:192" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:192: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:192" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:192" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:192: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:192" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:192" $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:192: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret gram_dir/foo.yy" at_fn_check_prepare_trace "output.at:192" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret gram_dir/foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:192" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:192: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(gram_dir/foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:192" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(gram_dir/foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/location.hh output_dir/position.hh output_dir/stack.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:192" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_108 #AT_START_109 at_fn_group_banner 109 'output.at:198' \ "Output files: lalr1.cc %defines %locations api.location.file=none %require \"3.2\" " "" 3 at_xfail=no ( $as_echo "109. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.tab.cc foo.tab.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %locations %define api.location.file none %require "3.2" %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:198: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:198" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:198" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:198: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:198" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:198" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:198: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:198" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:198" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:198: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:198" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:198" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:198: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:198" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:198" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:198: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:198" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:198" $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:198: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:198" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:198" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:198: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:198" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.tab.cc foo.tab.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:198" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:203' \ "Output files: lalr1.cc %defines %locations api.location.file=\"foo.loc.hh\" %require \"3.2\" " "" 3 at_xfail=no ( $as_echo "110. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.loc.hh foo.tab.cc foo.tab.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %locations %define api.location.file "foo.loc.hh" %require "3.2" %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:203: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:203" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:203" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:203: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:203" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:203" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:203: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:203" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:203" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:203: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:203" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:203" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:203: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:203" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:203" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:203: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:203" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:203" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:203: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:203" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:203" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:203: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:203" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.loc.hh foo.tab.cc foo.tab.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:203" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_110 #AT_START_111 at_fn_group_banner 111 'output.at:209' \ "Output files: lalr1.cc %defines %locations api.location.file=\"\$at_dir/foo.loc.hh\" %require \"3.2\" " "" 3 at_xfail=no ( $as_echo "111. $at_setup_line: testing $at_desc ..." $at_traceon for file in foo.yy foo.loc.hh foo.tab.cc foo.tab.hh; do case $file in */*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;; esac done cat >foo.yy <<'_ATEOF' %skeleton "lalr1.cc" %defines %locations %define api.location.file "$at_dir/foo.loc.hh" %require "3.2" %% foo: '0' {}; _ATEOF # There is no AT_DATA_UNQUOTED. if $EGREP 'at_dir' foo.yy >/dev/null; then { set +x $as_echo "$at_srcdir/output.at:209: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:209" ( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || 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:209" $at_failed && at_fn_log_failure $at_traceon; } # On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file. { set +x $as_echo "$at_srcdir/output.at:209: rm -f foo.yy.bak" at_fn_check_prepare_trace "output.at:209" ( $at_check_trace; rm -f foo.yy.bak ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:209" $at_failed && at_fn_log_failure $at_traceon; } 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/output.at:209: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv foo.yy" at_fn_check_prepare_notrace 'an embedded newline' "output.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:209" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:209: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:209" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:209: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:209" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:209" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:209: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:209" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:209" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:209: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy" at_fn_check_prepare_trace "output.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret foo.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:209" $at_failed && at_fn_log_failure $at_traceon; } # Ignore the files non-generated files { set +x $as_echo "$at_srcdir/output.at:209: find . -type f | \"\$PERL\" -ne ' s,\\./,,; chomp; push @file, \$_ unless m{^(foo.yy|testsuite.log)\$}; END { print join (\" \", sort @file), \"\\n\" }' || exit 77" at_fn_check_prepare_notrace 'an embedded newline' "output.at:209" ( $at_check_trace; find . -type f | "$PERL" -ne ' s,\./,,; chomp; push @file, $_ unless m{^(foo.yy|testsuite.log)$}; END { print join (" ", sort @file), "\n" }' || 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 "foo.loc.hh foo.tab.cc foo.tab.hh " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:209" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:239' \ "Conflicting output files: --graph=\"foo.tab.c\"" " " 3 at_xfail=no ( $as_echo "112. $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:239: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y" at_fn_check_prepare_trace "output.at:239" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'foo.tab.c' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:239" $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:239: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y -Werror" "output.at:239" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:239" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' foo.y: warning: conflicting outputs to file 'foo.tab.c' [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/output.at:239: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:239" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:239" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/output.at:239: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=error" "output.at:239" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:239" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/output.at:239: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y -Wnone,none -Werror --trace=none" "output.at:239" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:239" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:239: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=none -Werror --trace=none" "output.at:239" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:239" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:239: cat foo.y" at_fn_check_prepare_trace "output.at:239" ( $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:239" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:244' \ "Conflicting output files: %defines \"foo.output\" -v" "" 3 at_xfail=no ( $as_echo "113. $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:244: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v foo.y" at_fn_check_prepare_trace "output.at:244" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'foo.output' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:244" $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:244: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Werror" "output.at:244" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:244" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' foo.y: warning: conflicting outputs to file 'foo.output' [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/output.at:244: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:244" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:244" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/output.at:244: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=error" "output.at:244" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:244" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/output.at:244: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Wnone,none -Werror --trace=none" "output.at:244" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:244" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:244: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=none -Werror --trace=none" "output.at:244" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:244" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:244: cat foo.y" at_fn_check_prepare_trace "output.at:244" ( $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: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_113 #AT_START_114 at_fn_group_banner 114 'output.at:249' \ "Conflicting output files: lalr1.cc %defines %locations --graph=\"location.hh\"" "" 3 at_xfail=no ( $as_echo "114. $at_setup_line: testing $at_desc ..." $at_traceon case "foo.y" in */*) mkdir `echo "foo.y" | sed 's,/.*,,'`;; esac cat >foo.y <<'_ATEOF' %skeleton "lalr1.cc" %defines %locations %% foo: {}; _ATEOF cp foo.y expout # Because an output file name conflict is still a warning, Bison exits # with status 0, so AT_BISON_CHECK does not realize that there may be no # output file against which to check the XML. AT_BISON_CHECK_NO_XML # avoids that problem. { set +x $as_echo "$at_srcdir/output.at:249: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y" at_fn_check_prepare_trace "output.at:249" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --graph="location.hh" foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foo.y: warning: conflicting outputs to file 'location.hh' [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:249" $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:249: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y -Werror" "output.at:249" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="location.hh" foo.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:249" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' foo.y: warning: conflicting outputs to file 'location.hh' [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/output.at:249: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:249" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:249" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/output.at:249: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y --warnings=error" "output.at:249" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="location.hh" foo.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:249" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/output.at:249: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y -Wnone,none -Werror --trace=none" "output.at:249" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="location.hh" foo.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:249" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:249: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y --warnings=none -Werror --trace=none" "output.at:249" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="location.hh" foo.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:249" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:249: cat foo.y" at_fn_check_prepare_trace "output.at:249" ( $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: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_114 #AT_START_115 at_fn_group_banner 115 'output.at:253' \ "Conflicting output files: -o foo.y" " " 3 at_xfail=no ( $as_echo "115. $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:253: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o foo.y foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o foo.y foo.y" "output.at:253" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o foo.y foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foo.y: error: refusing to overwrite the input file 'foo.y' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/output.at:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:253: cat foo.y" at_fn_check_prepare_trace "output.at:253" ( $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: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_115 #AT_START_116 at_fn_group_banner 116 'output.at:297' \ "Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'" "" 3 at_xfail=no ( $as_echo "116. $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:297: touch \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.tmp\" || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $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:297" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:297: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:297: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:297" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:297: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:297" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:297" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:297: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:297" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:297: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:297: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\"" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $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:297" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:297" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:297" { set +x $as_echo "$at_srcdir/output.at:297: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" " at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $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:297" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:297: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:297: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:297" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:297: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:297" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:297" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:297: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:297" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:297: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --defines=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --defines="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:297: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\"" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:297" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:297" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:297" { set +x $as_echo "$at_srcdir/output.at:297: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" " at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:297" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:297" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:304' \ "Output file name: (" " " 3 at_xfail=no ( $as_echo "117. $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:304: touch \"(.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:304" ( $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:304" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:304: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"(.c\" --defines=\"(.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:304" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:304: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"(.c\" --defines=\"(.h\" glr.y" "output.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "(.c" --defines="(.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:304" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:304: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:304" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:304" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:304: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:304" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:304" $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:304: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"(.c\" --defines=\"(.h\" glr.y" at_fn_check_prepare_trace "output.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "(.c" --defines="(.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:304" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:304: ls \"(.c\" \"(.h\"" at_fn_check_prepare_trace "output.at:304" ( $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:304" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:304" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:304" { set +x $as_echo "$at_srcdir/output.at:304: \$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:304" ( $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:304" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:304: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"(.cc\" --defines=\"(.hh\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o "(.cc" --defines="(.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:304" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:304: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"(.cc\" --defines=\"(.hh\" cxx.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"(.cc\" --defines=\"(.hh\" cxx.y" "output.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "(.cc" --defines="(.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:304" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:304: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:304" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:304" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:304: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:304" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:304" $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:304: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"(.cc\" --defines=\"(.hh\" cxx.y" at_fn_check_prepare_trace "output.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "(.cc" --defines="(.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:304" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:304: ls \"(.cc\" \"(.hh\"" at_fn_check_prepare_trace "output.at:304" ( $at_check_trace; ls "(.cc" "(.hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:304" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:304" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:304" { set +x $as_echo "$at_srcdir/output.at:304: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"(.cc\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"(.cc\" " "output.at:304" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "(.cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:304" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:305' \ "Output file name: )" " " 3 at_xfail=no ( $as_echo "118. $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:305: touch \").tmp\" || exit 77" at_fn_check_prepare_trace "output.at:305" ( $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:305" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:305: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \").c\" --defines=\").h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:305" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:305: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \").c\" --defines=\").h\" glr.y" "output.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o ").c" --defines=").h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:305: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:305" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:305: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:305" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:305: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \").c\" --defines=\").h\" glr.y" at_fn_check_prepare_trace "output.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o ").c" --defines=").h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:305: ls \").c\" \").h\"" at_fn_check_prepare_trace "output.at:305" ( $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:305" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:305" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:305" { set +x $as_echo "$at_srcdir/output.at:305: \$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:305" ( $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:305" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:305: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \").cc\" --defines=\").hh\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o ").cc" --defines=").hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:305: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \").cc\" --defines=\").hh\" cxx.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \").cc\" --defines=\").hh\" cxx.y" "output.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o ").cc" --defines=").hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:305: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:305" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:305: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:305" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/output.at:305: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \").cc\" --defines=\").hh\" cxx.y" at_fn_check_prepare_trace "output.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o ").cc" --defines=").hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:305: ls \").cc\" \").hh\"" at_fn_check_prepare_trace "output.at:305" ( $at_check_trace; ls ").cc" ").hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:305" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:305" { set +x $as_echo "$at_srcdir/output.at:305: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \").cc\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \").cc\" " "output.at:305" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c ").cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:305" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_118 #AT_START_119 at_fn_group_banner 119 'output.at:306' \ "Output file name: #" " " 3 at_xfail=no ( $as_echo "119. $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:306: touch \"#.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:306" ( $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:306" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:306: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"#.c\" --defines=\"#.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:306" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:306" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:306: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"#.c\" --defines=\"#.h\" glr.y" "output.at:306" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "#.c" --defines="#.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:306" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:306: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:306" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:306" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:306: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:306" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:306" $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:306: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"#.c\" --defines=\"#.h\" glr.y" at_fn_check_prepare_trace "output.at:306" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "#.c" --defines="#.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:306" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:306: ls \"#.c\" \"#.h\"" at_fn_check_prepare_trace "output.at:306" ( $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:306" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:306" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:306" { set +x $as_echo "$at_srcdir/output.at:306: \$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:306" ( $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:306" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:306: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"#.cc\" --defines=\"#.hh\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:306" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o "#.cc" --defines="#.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:306" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:306: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"#.cc\" --defines=\"#.hh\" cxx.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"#.cc\" --defines=\"#.hh\" cxx.y" "output.at:306" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "#.cc" --defines="#.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:306" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:306: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:306" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:306" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:306: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:306" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:306" $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:306: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"#.cc\" --defines=\"#.hh\" cxx.y" at_fn_check_prepare_trace "output.at:306" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "#.cc" --defines="#.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:306" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:306: ls \"#.cc\" \"#.hh\"" at_fn_check_prepare_trace "output.at:306" ( $at_check_trace; ls "#.cc" "#.hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:306" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:306" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:306" { set +x $as_echo "$at_srcdir/output.at:306: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"#.cc\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"#.cc\" " "output.at:306" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "#.cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:306" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:307' \ "Output file name: @@" " " 3 at_xfail=no ( $as_echo "120. $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:307: touch \"@@.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:307" ( $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:307" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:307: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"@@.c\" --defines=\"@@.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:307" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:307: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@@.c\" --defines=\"@@.h\" glr.y" "output.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@@.c" --defines="@@.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:307" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:307: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:307" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:307" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:307: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:307" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:307" $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:307: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"@@.c\" --defines=\"@@.h\" glr.y" at_fn_check_prepare_trace "output.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "@@.c" --defines="@@.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:307" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:307: ls \"@@.c\" \"@@.h\"" at_fn_check_prepare_trace "output.at:307" ( $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:307" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:307" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:307" { set +x $as_echo "$at_srcdir/output.at:307: \$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:307" ( $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:307" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:307: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"@@.cc\" --defines=\"@@.hh\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o "@@.cc" --defines="@@.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:307" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:307: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@@.cc\" --defines=\"@@.hh\" cxx.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@@.cc\" --defines=\"@@.hh\" cxx.y" "output.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@@.cc" --defines="@@.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:307" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:307: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:307" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:307" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:307: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:307" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:307" $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:307: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"@@.cc\" --defines=\"@@.hh\" cxx.y" at_fn_check_prepare_trace "output.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "@@.cc" --defines="@@.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:307" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:307: ls \"@@.cc\" \"@@.hh\"" at_fn_check_prepare_trace "output.at:307" ( $at_check_trace; ls "@@.cc" "@@.hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:307" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:307" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:307" { set +x $as_echo "$at_srcdir/output.at:307: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@@.cc\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@@.cc\" " "output.at:307" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@@.cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:307" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:308' \ "Output file name: @{" " " 3 at_xfail=no ( $as_echo "121. $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:308: touch \"@{.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:308" ( $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:308" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:308: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"@{.c\" --defines=\"@{.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:308" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:308: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@{.c\" --defines=\"@{.h\" glr.y" "output.at:308" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@{.c" --defines="@{.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:308" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:308: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:308" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:308" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:308: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:308" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:308: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"@{.c\" --defines=\"@{.h\" glr.y" at_fn_check_prepare_trace "output.at:308" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "@{.c" --defines="@{.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:308: ls \"@{.c\" \"@{.h\"" at_fn_check_prepare_trace "output.at:308" ( $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:308" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:308" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:308" { set +x $as_echo "$at_srcdir/output.at:308: \$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:308" ( $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:308" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:308: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"@{.cc\" --defines=\"@{.hh\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:308" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o "@{.cc" --defines="@{.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:308: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@{.cc\" --defines=\"@{.hh\" cxx.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@{.cc\" --defines=\"@{.hh\" cxx.y" "output.at:308" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@{.cc" --defines="@{.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:308" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:308: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:308" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:308" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:308: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:308" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:308: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"@{.cc\" --defines=\"@{.hh\" cxx.y" at_fn_check_prepare_trace "output.at:308" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "@{.cc" --defines="@{.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:308" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:308: ls \"@{.cc\" \"@{.hh\"" at_fn_check_prepare_trace "output.at:308" ( $at_check_trace; ls "@{.cc" "@{.hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:308" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:308" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:308" { set +x $as_echo "$at_srcdir/output.at:308: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@{.cc\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@{.cc\" " "output.at:308" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@{.cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:308" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:309' \ "Output file name: @}" " " 3 at_xfail=no ( $as_echo "122. $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:309: touch \"@}.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:309" ( $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:309" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:309: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"@}.c\" --defines=\"@}.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:309" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:309" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:309: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@}.c\" --defines=\"@}.h\" glr.y" "output.at:309" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@}.c" --defines="@}.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:309" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:309: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:309" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:309" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:309: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:309" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:309" $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:309: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"@}.c\" --defines=\"@}.h\" glr.y" at_fn_check_prepare_trace "output.at:309" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "@}.c" --defines="@}.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:309" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:309: ls \"@}.c\" \"@}.h\"" at_fn_check_prepare_trace "output.at:309" ( $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:309" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:309" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:309" { set +x $as_echo "$at_srcdir/output.at:309: \$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:309" ( $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:309" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:309: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"@}.cc\" --defines=\"@}.hh\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:309" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o "@}.cc" --defines="@}.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:309" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:309: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@}.cc\" --defines=\"@}.hh\" cxx.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@}.cc\" --defines=\"@}.hh\" cxx.y" "output.at:309" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@}.cc" --defines="@}.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:309" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:309: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:309" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:309" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:309: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:309" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:309" $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:309: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"@}.cc\" --defines=\"@}.hh\" cxx.y" at_fn_check_prepare_trace "output.at:309" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "@}.cc" --defines="@}.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:309" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:309: ls \"@}.cc\" \"@}.hh\"" at_fn_check_prepare_trace "output.at:309" ( $at_check_trace; ls "@}.cc" "@}.hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:309" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:309" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:309" { set +x $as_echo "$at_srcdir/output.at:309: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"@}.cc\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"@}.cc\" " "output.at:309" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "@}.cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:309" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:310' \ "Output file name: [" " " 3 at_xfail=no ( $as_echo "123. $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:310: touch \"[.tmp\" || exit 77" at_fn_check_prepare_trace "output.at:310" ( $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:310" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"[.c\" --defines=\"[.h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:310" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"[.c\" --defines=\"[.h\" glr.y" "output.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "[.c" --defines="[.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:310" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:310: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:310" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:310" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:310: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:310" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:310" $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:310: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"[.c\" --defines=\"[.h\" glr.y" at_fn_check_prepare_trace "output.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "[.c" --defines="[.h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:310" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:310: ls \"[.c\" \"[.h\"" at_fn_check_prepare_trace "output.at:310" ( $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:310" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:310" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:310" { set +x $as_echo "$at_srcdir/output.at:310: \$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:310" ( $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:310" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"[.cc\" --defines=\"[.hh\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o "[.cc" --defines="[.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:310" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:310: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"[.cc\" --defines=\"[.hh\" cxx.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"[.cc\" --defines=\"[.hh\" cxx.y" "output.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "[.cc" --defines="[.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:310" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:310: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:310" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:310" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:310: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:310" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:310" $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:310: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"[.cc\" --defines=\"[.hh\" cxx.y" at_fn_check_prepare_trace "output.at:310" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "[.cc" --defines="[.hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:310" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:310: ls \"[.cc\" \"[.hh\"" at_fn_check_prepare_trace "output.at:310" ( $at_check_trace; ls "[.cc" "[.hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:310" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:310" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:310" { set +x $as_echo "$at_srcdir/output.at:310: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"[.cc\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"[.cc\" " "output.at:310" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "[.cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:310" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:311' \ "Output file name: ]" " " 3 at_xfail=no ( $as_echo "124. $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:311: touch \"].tmp\" || exit 77" at_fn_check_prepare_trace "output.at:311" ( $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:311" $at_failed && at_fn_log_failure $at_traceon; } cat >glr.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:311: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"].c\" --defines=\"].h\" glr.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:311" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:311" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:311: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"].c\" --defines=\"].h\" glr.y" "output.at:311" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "].c" --defines="].h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:311" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:311: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:311" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:311" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:311: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:311" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:311" $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:311: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"].c\" --defines=\"].h\" glr.y" at_fn_check_prepare_trace "output.at:311" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "].c" --defines="].h" glr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:311" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:311: ls \"].c\" \"].h\"" at_fn_check_prepare_trace "output.at:311" ( $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:311" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:311" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:311" { set +x $as_echo "$at_srcdir/output.at:311: \$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:311" ( $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:311" $at_failed && at_fn_log_failure $at_traceon; } cat >cxx.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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:311: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \"].cc\" --defines=\"].hh\" cxx.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:311" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o "].cc" --defines="].hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:311" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:311: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"].cc\" --defines=\"].hh\" cxx.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"].cc\" --defines=\"].hh\" cxx.y" "output.at:311" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "].cc" --defines="].hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:311" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:311: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:311" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:311" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:311: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:311" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:311" $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:311: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"].cc\" --defines=\"].hh\" cxx.y" at_fn_check_prepare_trace "output.at:311" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o "].cc" --defines="].hh" cxx.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:311" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:311: ls \"].cc\" \"].hh\"" at_fn_check_prepare_trace "output.at:311" ( $at_check_trace; ls "].cc" "].hh" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:311" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "output.at:311" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/output.at:311" { set +x $as_echo "$at_srcdir/output.at:311: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o cxx.o -c \"].cc\" " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c \"].cc\" " "output.at:311" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o cxx.o -c "].cc" ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:311" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:366' \ "Graph with no conflicts" " " 3 at_xfail=no ( $as_echo "125. $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:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:366" $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:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y" at_fn_check_prepare_trace "output.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:366: grep -v // input.dot" at_fn_check_prepare_trace "output.at:366" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . exp \$end\\l 1 exp: . a '?' b\\l 2 a: . %empty\\l\"] 0 -> 1 [style=dashed label=\"exp\"] 0 -> 2 [style=dashed label=\"a\"] 0 -> \"0R2\" [style=solid] \"0R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 0 \$accept: exp . \$end\\l\"] 1 -> 3 [style=solid label=\"\$end\"] 2 [label=\"State 2\\n\\l 1 exp: a . '?' b\\l\"] 2 -> 4 [style=solid label=\"'?'\"] 3 [label=\"State 3\\n\\l 0 \$accept: exp \$end .\\l\"] 3 -> \"3R0\" [style=solid] \"3R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 4 [label=\"State 4\\n\\l 1 exp: a '?' . b\\l 3 b: . 'b'\\l\"] 4 -> 5 [style=solid label=\"'b'\"] 4 -> 6 [style=dashed label=\"b\"] 5 [label=\"State 5\\n\\l 3 b: 'b' .\\l\"] 5 -> \"5R3\" [style=solid] \"5R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 6 [label=\"State 6\\n\\l 1 exp: a '?' b .\\l\"] 6 -> \"6R1\" [style=solid] \"6R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:430' \ "Graph with unsolved S/R" " " 3 at_xfail=no ( $as_echo "126. $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:430: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:430" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:430: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:430" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:430" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:430: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:430" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:430" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:430: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:430" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:430: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y" at_fn_check_prepare_trace "output.at:430" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:430" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:430: grep -v // input.dot" at_fn_check_prepare_trace "output.at:430" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . start \$end\\l 1 start: . 'a'\\l 2 | . empty_a 'a'\\l 3 | . 'b'\\l 4 | . empty_b 'b'\\l 5 | . 'c'\\l 6 | . empty_c 'c'\\l 7 empty_a: . %empty ['a']\\l 8 empty_b: . %empty ['b']\\l 9 empty_c: . %empty ['c']\\l\"] 0 -> 1 [style=solid label=\"'a'\"] 0 -> 2 [style=solid label=\"'b'\"] 0 -> 3 [style=solid label=\"'c'\"] 0 -> 4 [style=dashed label=\"start\"] 0 -> 5 [style=dashed label=\"empty_a\"] 0 -> 6 [style=dashed label=\"empty_b\"] 0 -> 7 [style=dashed label=\"empty_c\"] 0 -> \"0R7d\" [label=\"['a']\", style=solid] \"0R7d\" [label=\"R7\", fillcolor=5, shape=diamond, style=filled] 0 -> \"0R8d\" [label=\"['b']\", style=solid] \"0R8d\" [label=\"R8\", fillcolor=5, shape=diamond, style=filled] 0 -> \"0R9d\" [label=\"['c']\", style=solid] \"0R9d\" [label=\"R9\", fillcolor=5, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 1 start: 'a' .\\l\"] 1 -> \"1R1\" [style=solid] \"1R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 2 [label=\"State 2\\n\\l 3 start: 'b' .\\l\"] 2 -> \"2R3\" [style=solid] \"2R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 3 [label=\"State 3\\n\\l 5 start: 'c' .\\l\"] 3 -> \"3R5\" [style=solid] \"3R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] 4 [label=\"State 4\\n\\l 0 \$accept: start . \$end\\l\"] 4 -> 8 [style=solid label=\"\$end\"] 5 [label=\"State 5\\n\\l 2 start: empty_a . 'a'\\l\"] 5 -> 9 [style=solid label=\"'a'\"] 6 [label=\"State 6\\n\\l 4 start: empty_b . 'b'\\l\"] 6 -> 10 [style=solid label=\"'b'\"] 7 [label=\"State 7\\n\\l 6 start: empty_c . 'c'\\l\"] 7 -> 11 [style=solid label=\"'c'\"] 8 [label=\"State 8\\n\\l 0 \$accept: start \$end .\\l\"] 8 -> \"8R0\" [style=solid] \"8R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 2 start: empty_a 'a' .\\l\"] 9 -> \"9R2\" [style=solid] \"9R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 10 [label=\"State 10\\n\\l 4 start: empty_b 'b' .\\l\"] 10 -> \"10R4\" [style=solid] \"10R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 11 [label=\"State 11\\n\\l 6 start: empty_c 'c' .\\l\"] 11 -> \"11R6\" [style=solid] \"11R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at: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_126 #AT_START_127 at_fn_group_banner 127 'output.at:489' \ "Graph with solved S/R" " " 3 at_xfail=no ( $as_echo "127. $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:489: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:489" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:489" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:489: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:489" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:489" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:489: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:489" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:489" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:489: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:489" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:489" $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:489: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y" at_fn_check_prepare_trace "output.at:489" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:489" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:489: grep -v // input.dot" at_fn_check_prepare_trace "output.at:489" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . start \$end\\l 1 start: . 'a'\\l 2 | . empty_a 'a'\\l 3 | . 'b'\\l 4 | . empty_b 'b'\\l 5 | . 'c'\\l 6 | . empty_c 'c'\\l 7 empty_a: . %empty ['a']\\l 8 empty_b: . %empty []\\l 9 empty_c: . %empty []\\l\"] 0 -> 1 [style=solid label=\"'b'\"] 0 -> 2 [style=solid label=\"'c'\"] 0 -> 3 [style=dashed label=\"start\"] 0 -> 4 [style=dashed label=\"empty_a\"] 0 -> 5 [style=dashed label=\"empty_b\"] 0 -> 6 [style=dashed label=\"empty_c\"] 0 -> \"0R7\" [style=solid] \"0R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 3 start: 'b' .\\l\"] 1 -> \"1R3\" [style=solid] \"1R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 2 [label=\"State 2\\n\\l 5 start: 'c' .\\l\"] 2 -> \"2R5\" [style=solid] \"2R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] 3 [label=\"State 3\\n\\l 0 \$accept: start . \$end\\l\"] 3 -> 7 [style=solid label=\"\$end\"] 4 [label=\"State 4\\n\\l 2 start: empty_a . 'a'\\l\"] 4 -> 8 [style=solid label=\"'a'\"] 5 [label=\"State 5\\n\\l 4 start: empty_b . 'b'\\l\"] 5 -> 9 [style=solid label=\"'b'\"] 6 [label=\"State 6\\n\\l 6 start: empty_c . 'c'\\l\"] 6 -> 10 [style=solid label=\"'c'\"] 7 [label=\"State 7\\n\\l 0 \$accept: start \$end .\\l\"] 7 -> \"7R0\" [style=solid] \"7R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 8 [label=\"State 8\\n\\l 2 start: empty_a 'a' .\\l\"] 8 -> \"8R2\" [style=solid] \"8R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 4 start: empty_b 'b' .\\l\"] 9 -> \"9R4\" [style=solid] \"9R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 10 [label=\"State 10\\n\\l 6 start: empty_c 'c' .\\l\"] 10 -> \"10R6\" [style=solid] \"10R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:489" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:521' \ "Graph with R/R" " " 3 at_xfail=no ( $as_echo "128. $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:521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:521" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:521: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:521" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:521" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:521: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:521" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/output.at:521: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y" at_fn_check_prepare_trace "output.at:521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:521: grep -v // input.dot" at_fn_check_prepare_trace "output.at:521" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . exp \$end\\l 1 exp: . a\\l 2 | . b\\l 3 a: . %empty [\$end]\\l 4 b: . %empty [\$end]\\l\"] 0 -> 1 [style=dashed label=\"exp\"] 0 -> 2 [style=dashed label=\"a\"] 0 -> 3 [style=dashed label=\"b\"] 0 -> \"0R3\" [style=solid] \"0R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 0 -> \"0R4d\" [label=\"[\$end]\", style=solid] \"0R4d\" [label=\"R4\", fillcolor=5, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 0 \$accept: exp . \$end\\l\"] 1 -> 4 [style=solid label=\"\$end\"] 2 [label=\"State 2\\n\\l 1 exp: a .\\l\"] 2 -> \"2R1\" [style=solid] \"2R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 3 [label=\"State 3\\n\\l 2 exp: b .\\l\"] 3 -> \"3R2\" [style=solid] \"3R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 4 [label=\"State 4\\n\\l 0 \$accept: exp \$end .\\l\"] 4 -> \"4R0\" [style=solid] \"4R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:521" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:580' \ "Graph with reductions with multiple LAT" " " 3 at_xfail=no ( $as_echo "129. $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:580: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:580" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:580: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:580" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:580: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:580" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:580" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:580: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:580" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:580" $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:580: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y" at_fn_check_prepare_trace "output.at:580" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:580" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:580: grep -v // input.dot" at_fn_check_prepare_trace "output.at:580" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . exp \$end\\l 1 exp: . a ';'\\l 2 | . a ';'\\l 3 | . a '.'\\l 4 | . b '?'\\l 5 | . b '!'\\l 6 | . c '?'\\l 7 | . c ';'\\l 8 a: . %empty [';', '.']\\l 9 b: . %empty ['?', '!']\\l 10 c: . %empty [';', '?']\\l\"] 0 -> 1 [style=dashed label=\"exp\"] 0 -> 2 [style=dashed label=\"a\"] 0 -> 3 [style=dashed label=\"b\"] 0 -> 4 [style=dashed label=\"c\"] 0 -> \"0R8\" [style=solid] \"0R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled] 0 -> \"0R9\" [label=\"['?', '!']\", style=solid] \"0R9\" [label=\"R9\", fillcolor=3, shape=diamond, style=filled] 0 -> \"0R10d\" [label=\"[';', '?']\", style=solid] \"0R10d\" [label=\"R10\", fillcolor=5, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 0 \$accept: exp . \$end\\l\"] 1 -> 5 [style=solid label=\"\$end\"] 2 [label=\"State 2\\n\\l 1 exp: a . ';'\\l 2 | a . ';'\\l 3 | a . '.'\\l\"] 2 -> 6 [style=solid label=\"';'\"] 2 -> 7 [style=solid label=\"'.'\"] 3 [label=\"State 3\\n\\l 4 exp: b . '?'\\l 5 | b . '!'\\l\"] 3 -> 8 [style=solid label=\"'?'\"] 3 -> 9 [style=solid label=\"'!'\"] 4 [label=\"State 4\\n\\l 6 exp: c . '?'\\l 7 | c . ';'\\l\"] 4 -> 10 [style=solid label=\"';'\"] 4 -> 11 [style=solid label=\"'?'\"] 5 [label=\"State 5\\n\\l 0 \$accept: exp \$end .\\l\"] 5 -> \"5R0\" [style=solid] \"5R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 6 [label=\"State 6\\n\\l 1 exp: a ';' . [\$end]\\l 2 | a ';' . [\$end]\\l\"] 6 -> \"6R1\" [style=solid] \"6R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 6 -> \"6R2d\" [label=\"[\$end]\", style=solid] \"6R2d\" [label=\"R2\", fillcolor=5, shape=diamond, style=filled] 7 [label=\"State 7\\n\\l 3 exp: a '.' .\\l\"] 7 -> \"7R3\" [style=solid] \"7R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 8 [label=\"State 8\\n\\l 4 exp: b '?' .\\l\"] 8 -> \"8R4\" [style=solid] \"8R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 5 exp: b '!' .\\l\"] 9 -> \"9R5\" [style=solid] \"9R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] 10 [label=\"State 10\\n\\l 7 exp: c ';' .\\l\"] 10 -> \"10R7\" [style=solid] \"10R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled] 11 [label=\"State 11\\n\\l 6 exp: c '?' .\\l\"] 11 -> \"11R6\" [style=solid] \"11R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:580" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'output.at:674' \ "Graph with a reduction rule both enabled and disabled" "" 3 at_xfail=no ( $as_echo "130. $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:674: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -rall --graph input.y" at_fn_check_prepare_notrace 'an embedded newline' "output.at:674" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:674" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:674: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:674" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/output.at:674" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/output.at:674: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:674" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:674" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/output.at:674: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:674" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:674" $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:674: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y" at_fn_check_prepare_trace "output.at:674" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -rall --graph input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:674" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/output.at:674: grep -v // input.dot" at_fn_check_prepare_trace "output.at:674" ( $at_check_trace; grep -v // input.dot ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " digraph \"input.y\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . exp \$end\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 7 opexp: . exp '+' exp\\l 8 imm: . '0'\\l\"] 0 -> 1 [style=solid label=\"\\\"if\\\"\"] 0 -> 2 [style=solid label=\"'0'\"] 0 -> 3 [style=dashed label=\"exp\"] 0 -> 4 [style=dashed label=\"ifexp\"] 0 -> 5 [style=dashed label=\"opexp\"] 0 -> 6 [style=dashed label=\"imm\"] 1 [label=\"State 1\\n\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 4 | \\\"if\\\" . exp \\\"then\\\" exp elseexp\\l 7 opexp: . exp '+' exp\\l 8 imm: . '0'\\l\"] 1 -> 1 [style=solid label=\"\\\"if\\\"\"] 1 -> 2 [style=solid label=\"'0'\"] 1 -> 7 [style=dashed label=\"exp\"] 1 -> 4 [style=dashed label=\"ifexp\"] 1 -> 5 [style=dashed label=\"opexp\"] 1 -> 6 [style=dashed label=\"imm\"] 2 [label=\"State 2\\n\\l 8 imm: '0' .\\l\"] 2 -> \"2R8\" [style=solid] \"2R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled] 3 [label=\"State 3\\n\\l 0 \$accept: exp . \$end\\l 7 opexp: exp . '+' exp\\l\"] 3 -> 8 [style=solid label=\"\$end\"] 3 -> 9 [style=solid label=\"'+'\"] 4 [label=\"State 4\\n\\l 1 exp: ifexp .\\l\"] 4 -> \"4R1\" [style=solid] \"4R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 5 [label=\"State 5\\n\\l 2 exp: opexp .\\l\"] 5 -> \"5R2\" [style=solid] \"5R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 6 [label=\"State 6\\n\\l 3 exp: imm .\\l\"] 6 -> \"6R3\" [style=solid] \"6R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 7 [label=\"State 7\\n\\l 4 ifexp: \\\"if\\\" exp . \\\"then\\\" exp elseexp\\l 7 opexp: exp . '+' exp\\l\"] 7 -> 10 [style=solid label=\"\\\"then\\\"\"] 7 -> 9 [style=solid label=\"'+'\"] 8 [label=\"State 8\\n\\l 0 \$accept: exp \$end .\\l\"] 8 -> \"8R0\" [style=solid] \"8R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 7 opexp: . exp '+' exp\\l 7 | exp '+' . exp\\l 8 imm: . '0'\\l\"] 9 -> 1 [style=solid label=\"\\\"if\\\"\"] 9 -> 2 [style=solid label=\"'0'\"] 9 -> 11 [style=dashed label=\"exp\"] 9 -> 4 [style=dashed label=\"ifexp\"] 9 -> 5 [style=dashed label=\"opexp\"] 9 -> 6 [style=dashed label=\"imm\"] 10 [label=\"State 10\\n\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 4 | \\\"if\\\" exp \\\"then\\\" . exp elseexp\\l 7 opexp: . exp '+' exp\\l 8 imm: . '0'\\l\"] 10 -> 1 [style=solid label=\"\\\"if\\\"\"] 10 -> 2 [style=solid label=\"'0'\"] 10 -> 12 [style=dashed label=\"exp\"] 10 -> 4 [style=dashed label=\"ifexp\"] 10 -> 5 [style=dashed label=\"opexp\"] 10 -> 6 [style=dashed label=\"imm\"] 11 [label=\"State 11\\n\\l 7 opexp: exp . '+' exp\\l 7 | exp '+' exp . [\$end, \\\"then\\\", \\\"else\\\", '+']\\l\"] 11 -> 9 [style=solid label=\"'+'\"] 11 -> \"11R7d\" [label=\"['+']\", style=solid] \"11R7d\" [label=\"R7\", fillcolor=5, shape=diamond, style=filled] 11 -> \"11R7\" [style=solid] \"11R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled] 12 [label=\"State 12\\n\\l 4 ifexp: \\\"if\\\" exp \\\"then\\\" exp . elseexp\\l 5 elseexp: . \\\"else\\\" exp\\l 6 | . %empty [\$end, \\\"then\\\", \\\"else\\\", '+']\\l 7 opexp: exp . '+' exp\\l\"] 12 -> 13 [style=solid label=\"\\\"else\\\"\"] 12 -> 9 [style=solid label=\"'+'\"] 12 -> 14 [style=dashed label=\"elseexp\"] 12 -> \"12R6d\" [label=\"[\\\"else\\\", '+']\", style=solid] \"12R6d\" [label=\"R6\", fillcolor=5, shape=diamond, style=filled] 12 -> \"12R6\" [style=solid] \"12R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] 13 [label=\"State 13\\n\\l 1 exp: . ifexp\\l 2 | . opexp\\l 3 | . imm\\l 4 ifexp: . \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 5 elseexp: \\\"else\\\" . exp\\l 7 opexp: . exp '+' exp\\l 8 imm: . '0'\\l\"] 13 -> 1 [style=solid label=\"\\\"if\\\"\"] 13 -> 2 [style=solid label=\"'0'\"] 13 -> 15 [style=dashed label=\"exp\"] 13 -> 4 [style=dashed label=\"ifexp\"] 13 -> 5 [style=dashed label=\"opexp\"] 13 -> 6 [style=dashed label=\"imm\"] 14 [label=\"State 14\\n\\l 4 ifexp: \\\"if\\\" exp \\\"then\\\" exp elseexp .\\l\"] 14 -> \"14R4\" [style=solid] \"14R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 15 [label=\"State 15\\n\\l 5 elseexp: \\\"else\\\" exp . [\$end, \\\"then\\\", \\\"else\\\", '+']\\l 7 opexp: exp . '+' exp\\l\"] 15 -> 9 [style=solid label=\"'+'\"] 15 -> \"15R5d\" [label=\"['+']\", style=solid] \"15R5d\" [label=\"R5\", fillcolor=5, shape=diamond, style=filled] 15 -> \"15R5\" [style=solid] \"15R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/output.at:674" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:107' \ "Warnings" " " 4 at_xfail=no ( $as_echo "131. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:107" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:107" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %token FOO FOO FOO %token FOO FOO FOO %% exp: %empty; _ATEOF cat >experr <<'_ATEOF' input.y:9.12-14: warning: symbol FOO redeclared [-Wother] 9 | %token FOO FOO FOO | ^~~ input.y:9.8-10: previous declaration 9 | %token FOO FOO FOO | ^~~ input.y:9.16-18: warning: symbol FOO redeclared [-Wother] 9 | %token FOO FOO FOO | ^~~ input.y:9.8-10: previous declaration 9 | %token FOO FOO FOO | ^~~ input.y:10.8-10: warning: symbol FOO redeclared [-Wother] 10 | %token FOO FOO FOO | ^~~ input.y:9.8-10: previous declaration 9 | %token FOO FOO FOO | ^~~ input.y:10.13-15: warning: symbol FOO redeclared [-Wother] 10 | %token FOO FOO FOO | ^~~ input.y:9.8-10: previous declaration 9 | %token FOO FOO FOO | ^~~ input.y:10.18-20: warning: symbol FOO redeclared [-Wother] 10 | %token FOO FOO FOO | ^~~ input.y:9.8-10: previous declaration 9 | %token FOO FOO FOO | ^~~ _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:107: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:107" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:107" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:107: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:107" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:107" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:107: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:107" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:107" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:107: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:107" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:107" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_131 #AT_START_132 at_fn_group_banner 132 'diagnostics.at:152' \ "Single point locations" " " 4 at_xfail=no ( $as_echo "132. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:152" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:152" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% exp: a b c d e a: {} b:{ }; c: d : e: _ATEOF cat >experr <<'_ATEOF' input.y:11.4-5: warning: empty rule without %empty [-Wempty-rule] 11 | a: {} | ^~ | %empty input.y:12.3-13.1: warning: empty rule without %empty [-Wempty-rule] 12 | b:{ | ^ | %empty input.y:14.3: warning: empty rule without %empty [-Wempty-rule] 14 | c: | ^ | %empty input.y:16.2: warning: empty rule without %empty [-Wempty-rule] 16 | : | ^ | %empty input.y:17.3: warning: empty rule without %empty [-Wempty-rule] 17 | e: | ^ | %empty input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:152: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:152" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:152" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:152: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:152" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:152" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:152: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:152" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:152" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:152: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:152" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:152" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:193' \ "Line is too short, and then you die" " " 4 at_xfail=no ( $as_echo "133. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:193" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:193" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } // Beware that there are 9 lines inserted before (including this one). #line 12 %token foo 123 %token foo 123123 %token foo 123 %% exp: _ATEOF cat >experr <<'_ATEOF' input.y:13.8-10: warning: symbol foo redeclared [-Wother] 13 | %token foo 123 | ^~~ input.y:12.8-10: previous declaration 12 | %token foo 123123 | ^~~ input.y:13.12-17: error: redefining user token number of foo 13 | %token foo 123 | ^~~~~~ input.y:14.8-10: warning: symbol foo redeclared [-Wother] 14 | %% | ^~~ input.y:12.8-10: previous declaration 12 | %token foo 123123 | ^~~ _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:193: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:193" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:193" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:193: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:193" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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/diagnostics.at:193" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:193: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:193" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:193" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:193: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:193" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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/diagnostics.at:193" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:211' \ "Zero-width characters" " " 4 at_xfail=no ( $as_echo "134. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:211" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:211" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% exp: an\005error. _ATEOF cat >experr <<'_ATEOF' input.y:10.8: error: invalid character: '\\005' 10 | exp: an\005error. | ^ _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:211: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:211" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:211" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:211: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:211" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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/diagnostics.at:211" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:211: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:211" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:211" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:211: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:211" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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/diagnostics.at:211" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:267' \ "Tabulations and multibyte characters" " " 4 at_xfail=no ( $as_echo "135. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:267" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:267" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% exp: a b c d e f g h a: { } b: { } c: {------------} d: {éééééééééééé} e: {∇⃗×𝐸⃗ = -∂𝐵⃗/∂t} f: { 42 } g: { "฿¥$€₦" } h: { 🐃 } _ATEOF cat >experr <<'_ATEOF' input.y:11.4-17: warning: empty rule without %empty [-Wempty-rule] 11 | a: { } | ^~~~~~~~~~~~~~ | %empty input.y:12.4-17: warning: empty rule without %empty [-Wempty-rule] 12 | b: { } | ^~~~~~~~~~~~~~ | %empty input.y:13.4-17: warning: empty rule without %empty [-Wempty-rule] 13 | c: {------------} | ^~~~~~~~~~~~~~ | %empty input.y:14.4-17: warning: empty rule without %empty [-Wempty-rule] 14 | d: {éééééééééééé} | ^~~~~~~~~~~~~~ | %empty input.y:15.4-17: warning: empty rule without %empty [-Wempty-rule] 15 | e: {∇⃗×𝐸⃗ = -∂𝐵⃗/∂t} | ^~~~~~~~~~~~~~ | %empty input.y:16.4-17: warning: empty rule without %empty [-Wempty-rule] 16 | f: { 42 } | ^~~~~~~~~~~~~~ | %empty input.y:17.4-17: warning: empty rule without %empty [-Wempty-rule] 17 | g: { "฿¥$€₦" } | ^~~~~~~~~~~~~~ | %empty input.y:18.4-17: warning: empty rule without %empty [-Wempty-rule] 18 | h: { 🐃 } | ^~~~~~~~~~~~~~ | %empty input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:267: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:267" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:267" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:267: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:267" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:267" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:267: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:267" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:267" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:267: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:267" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:267" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:293' \ "Special files" " " 4 at_xfail=no ( $as_echo "136. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:293" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:293" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% exp: a b a: {} #line 1 "/dev/stdout" b: {} _ATEOF cat >experr <<'_ATEOF' input.y:11.4-5: warning: empty rule without %empty [-Wempty-rule] 11 | a: {} | ^~ | %empty /dev/stdout:1.4-5: warning: empty rule without %empty [-Wempty-rule] | %empty input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:293: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:293" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:293" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:293: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:293" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:293" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:293: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:293" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:293" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:293: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:293" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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 0 $at_status "$at_srcdir/diagnostics.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_136 #AT_START_137 at_fn_group_banner 137 'diagnostics.at:316' \ "Complaints from M4" " " 4 at_xfail=no ( $as_echo "137. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:316" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:316" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define error1 {e} %define error2 {é} %% exp: %empty; _ATEOF cat >experr <<'_ATEOF' input.y:9.1-27: error: %define variable 'error1' is not used 9 | %define error1 {e} | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:10.1-27: error: %define variable 'error2' is not used 10 | %define error2 {é} | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:316: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:316" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:316" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:316: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:316" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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/diagnostics.at:316" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:316: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:316" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:316" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:316: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:316" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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/diagnostics.at:316" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:338' \ "Carriage return" " " 4 at_xfail=no ( $as_echo "138. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:338" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:338" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } ^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M %token " %% _ATEOF cat >experr <<'_ATEOF' input.y:10.8-11.0: error: missing '"' at end of line 10 | %token " | ^ input.y:10.8-11.0: error: syntax error, unexpected string, expecting character literal or identifier or 10 | %token " | ^ _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:338: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:338" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:338" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:338: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:338" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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/diagnostics.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:338: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:338" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:338" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:338: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:338" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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/diagnostics.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:366' \ "CR NL" " " 4 at_xfail=no ( $as_echo "139. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:366" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:366" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } ^M %token ^M FOO^M %token ^M FOO^M %%^M exp:^M _ATEOF cat >experr <<'_ATEOF' input.y:11.9-11: warning: symbol FOO redeclared [-Wother] 11 | %token FOO | ^~~ input.y:10.9-11: previous declaration 10 | %token FOO | ^~~ input.y:13.5: warning: empty rule without %empty [-Wempty-rule] 13 | exp: | ^ | %empty input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:366: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:366" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:366" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:366: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:366" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:366" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:366: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:366" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:366" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:366: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:366" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:405' \ "Screen width: 200 columns" " " 4 at_xfail=no ( $as_echo "140. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:405" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:405" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ %error-verbose %% exp: ABCDEFGHIJKLMNOPQRSTUVWXYZ _ATEOF cat >experr <<'_ATEOF' input.y:9.36-61: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.64-89: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.92-117: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:10.56-69: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated] 10 | %error-verbose | ^~~~~~~~~~~~~~ | %define parse.error verbose input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:405: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:405" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:405" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:405: LC_ALL=\"\$locale\" COLUMNS=200 bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" COLUMNS=200 bison -fcaret --color=debug -Wall input.y" "diagnostics.at:405" ( $at_check_trace; LC_ALL="$locale" COLUMNS=200 bison -fcaret --color=debug -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:405" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:405: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:405" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:405" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:405: LC_ALL=\"\$locale\" COLUMNS=200 bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" COLUMNS=200 bison -fcaret -Wall input.y" "diagnostics.at:405" ( $at_check_trace; LC_ALL="$locale" COLUMNS=200 bison -fcaret -Wall 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 0 $at_status "$at_srcdir/diagnostics.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_140 #AT_START_141 at_fn_group_banner 141 'diagnostics.at:438' \ "Screen width: 80 columns" " " 4 at_xfail=no ( $as_echo "141. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:438" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:438" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ %error-verbose %% exp: ABCDEFGHIJKLMNOPQRSTUVWXYZ _ATEOF cat >experr <<'_ATEOF' input.y:9.36-61: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEF... | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEF... | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.64-89: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEF... | ^~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEF... | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.92-117: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | ...TUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEF... | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:10.56-69: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated] 10 | %error-verbose | ^~~~~~~~~~~~~~ | %define parse.error verbose input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:438: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:438" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:438" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:438: LC_ALL=\"\$locale\" COLUMNS=80 bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" COLUMNS=80 bison -fcaret --color=debug -Wall input.y" "diagnostics.at:438" ( $at_check_trace; LC_ALL="$locale" COLUMNS=80 bison -fcaret --color=debug -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:438" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:438: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:438" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:438" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:438: LC_ALL=\"\$locale\" COLUMNS=80 bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" COLUMNS=80 bison -fcaret -Wall input.y" "diagnostics.at:438" ( $at_check_trace; LC_ALL="$locale" COLUMNS=80 bison -fcaret -Wall 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 0 $at_status "$at_srcdir/diagnostics.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_141 #AT_START_142 at_fn_group_banner 142 'diagnostics.at:471' \ "Screen width: 60 columns" " " 4 at_xfail=no ( $as_echo "142. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:471" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:471" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ %error-verbose %% exp: ABCDEFGHIJKLMNOPQRSTUVWXYZ _ATEOF cat >experr <<'_ATEOF' input.y:9.36-61: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMN... | ^~~~~~~~~~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMN... | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.64-89: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | ...TUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHI... | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMN... | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.92-117: warning: symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [-Wother] 9 | ...TUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:9.8-33: previous declaration 9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMN... | ^~~~~~~~~~~~~~~~~~~~~~~~~~ input.y:10.56-69: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated] 10 | ... %error-verbose | ^~~~~~~~~~~~~~ | %define parse.error verbose input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:471: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:471" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:471" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:471: LC_ALL=\"\$locale\" COLUMNS=60 bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" COLUMNS=60 bison -fcaret --color=debug -Wall input.y" "diagnostics.at:471" ( $at_check_trace; LC_ALL="$locale" COLUMNS=60 bison -fcaret --color=debug -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:471" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:471: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:471" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:471" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:471: LC_ALL=\"\$locale\" COLUMNS=60 bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" COLUMNS=60 bison -fcaret -Wall input.y" "diagnostics.at:471" ( $at_check_trace; LC_ALL="$locale" COLUMNS=60 bison -fcaret -Wall 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 0 $at_status "$at_srcdir/diagnostics.at:471" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:495' \ "Suggestions" " " 4 at_xfail=no ( $as_echo "143. $at_setup_line: testing $at_desc ..." $at_traceon # We need UTF-8 support for correct screen-width computation of UTF-8 # characters. Skip the test if not available. locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q` $as_echo "diagnostics.at:495" >"$at_check_line_file" (test x == x"$locale") \ && at_fn_check_skip 77 "$at_srcdir/diagnostics.at:495" cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% res: QUX baz bar: QUUX _ATEOF cat >experr <<'_ATEOF' input.y:10.6-8: error: symbol 'QUX' is used, but is not defined as a token and has no rules 10 | res: QUX baz | ^~~ input.y:10.10-12: error: symbol 'baz' is used, but is not defined as a token and has no rules; did you mean 'bar'? 10 | res: QUX baz | ^~~ | bar input.y:11.6-9: error: symbol 'QUUX' is used, but is not defined as a token and has no rules 11 | bar: QUUX | ^~~~ _ATEOF # For some reason, literal ^M in the input are removed and don't end # in `input.y`. So use the two-character ^M represent it, and let # Perl insert real CR characters. if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then { set +x $as_echo "$at_srcdir/diagnostics.at:495: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:495" ( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || 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/diagnostics.at:495" $at_failed && at_fn_log_failure $at_traceon; } fi { set +x $as_echo "$at_srcdir/diagnostics.at:495: LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall input.y" "diagnostics.at:495" ( $at_check_trace; LC_ALL="$locale" bison -fcaret --color=debug -Wall 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/diagnostics.at:495" $at_failed && at_fn_log_failure $at_traceon; } # When no style, same messages, but without style. { set +x $as_echo "$at_srcdir/diagnostics.at:495: \"\$PERL\" -pi -e 's{()}{ \$1 eq \"\" ? \$1 : \"\" }ge' experr || exit 77" at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:495" ( $at_check_trace; "$PERL" -pi -e 's{()}{ $1 eq "" ? $1 : "" }ge' experr || 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/diagnostics.at:495" $at_failed && at_fn_log_failure $at_traceon; } # Cannot use AT_BISON_CHECK easily as we need to change the # environment. # FIXME: Enhance AT_BISON_CHECK. { set +x $as_echo "$at_srcdir/diagnostics.at:495: LC_ALL=\"\$locale\" bison -fcaret -Wall input.y" at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fcaret -Wall input.y" "diagnostics.at:495" ( $at_check_trace; LC_ALL="$locale" bison -fcaret -Wall 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/diagnostics.at:495" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'diagnostics.at:510' \ "Indentation with message suppression" " " 4 at_xfail=no ( $as_echo "144. $at_setup_line: testing $at_desc ..." $at_traceon # https://lists.gnu.org/archive/html/bug-bison/2019-08/msg00002.html cat >input.y <<'_ATEOF' %define api.pure %pure-parser %error-verbose %% 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/diagnostics.at:531: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -Wno-other input.y" at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -Wno-other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/diagnostics.at:531: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-other input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-other input.y" "diagnostics.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:531" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/diagnostics.at:531: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "diagnostics.at:531" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:531" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/diagnostics.at:531: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "diagnostics.at:531" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.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/diagnostics.at:531: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wno-other input.y" at_fn_check_prepare_trace "diagnostics.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wno-other input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [-Wdeprecated] 2 | %pure-parser | ^~~~~~~~~~~~ | %define api.pure input.y:3.1-14: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated] 3 | %error-verbose | ^~~~~~~~~~~~~~ | %define parse.error verbose " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:531" $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/diagnostics.at:531: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Werror" "diagnostics.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other 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/diagnostics.at:531" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [-Wdeprecated] 2 | %pure-parser | ^~~~~~~~~~~~ | %define api.pure input.y:3.1-14: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated] 3 | %error-verbose | ^~~~~~~~~~~~~~ | %define parse.error verbose _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/diagnostics.at:531: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "diagnostics.at:531" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:531" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/diagnostics.at:531: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=error" "diagnostics.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other 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/diagnostics.at:531" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/diagnostics.at:531: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Wnone,none -Werror --trace=none" "diagnostics.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/diagnostics.at:531: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=none -Werror --trace=none" "diagnostics.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:531" $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_144 #AT_START_145 at_fn_group_banner 145 'skeletons.at:25' \ "Relative skeleton file names" " " 5 at_xfail=no ( $as_echo "145. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/skeletons.at:27: mkdir tmp" at_fn_check_prepare_trace "skeletons.at:27" ( $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:27" $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:63: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv tmp/input-gram.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:63" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:63" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:63: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml tmp/input-gram.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml tmp/input-gram.y" "skeletons.at:63" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml tmp/input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:63: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:63" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:63" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/skeletons.at:63: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:63" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/skeletons.at:63: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret tmp/input-gram.y" at_fn_check_prepare_trace "skeletons.at:63" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret tmp/input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:66: cat input-gram.tab.c" at_fn_check_prepare_trace "skeletons.at:66" ( $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:66" $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:68: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input-gram.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:68" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:68" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:68: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-gram.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-gram.y" "skeletons.at:68" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:68: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:68" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:68" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/skeletons.at:68: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:68" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:68" $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:68: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input-gram.y" at_fn_check_prepare_trace "skeletons.at:68" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:71: cat input-gram.tab.c" at_fn_check_prepare_trace "skeletons.at:71" ( $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:71" $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:73: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --skeleton=tmp/skel.c tmp/input-cmd-line.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:73" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:73" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:73: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y" "skeletons.at:73" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:73: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:73" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:73" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/skeletons.at:73: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:73" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/skeletons.at:73: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --skeleton=tmp/skel.c tmp/input-cmd-line.y" at_fn_check_prepare_trace "skeletons.at:73" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --skeleton=tmp/skel.c tmp/input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:76: cat input-cmd-line.tab.c" at_fn_check_prepare_trace "skeletons.at:76" ( $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: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_145 #AT_START_146 at_fn_group_banner 146 'skeletons.at:85' \ "Installed skeleton file names" " " 5 at_xfail=no ( $as_echo "146. $at_setup_line: testing $at_desc ..." $at_traceon cat >input-cmd-line.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include static void yyerror (const char *msg); int yylex (void); %} %define parse.error verbose %token 'a' %% start: ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'a'; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF cat >input-gram.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "yacc.c" %{ #include #include static void yyerror (const char *msg); int yylex (void); %} %define parse.error verbose %token 'a' %% start: ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'a'; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/skeletons.at:120: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:120" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:120" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:120: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" "skeletons.at:120" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:120" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:120: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:120" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:120" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/skeletons.at:120: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:120" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:120" $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:120: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" at_fn_check_prepare_trace "skeletons.at:120" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:120" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "skeletons.at:121" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/skeletons.at:121" { set +x $as_echo "$at_srcdir/skeletons.at:121: \$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:121" ( $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:121" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:124: \$PREPARSER ./input-cmd-line" at_fn_check_prepare_dynamic " $PREPARSER ./input-cmd-line" "skeletons.at:124" ( $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:124" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:124: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "skeletons.at:124" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:124" $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:126: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input-gram.c input-gram.y" at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:126" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:126" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:126: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input-gram.c input-gram.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input-gram.c input-gram.y" "skeletons.at:126" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input-gram.c input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/skeletons.at:126: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:126" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:126" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/skeletons.at:126: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:126" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:126" $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:126: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input-gram.c input-gram.y" at_fn_check_prepare_trace "skeletons.at:126" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input-gram.c input-gram.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "skeletons.at:127" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/skeletons.at:127" { set +x $as_echo "$at_srcdir/skeletons.at:127: \$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:127" ( $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:127" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:130: \$PREPARSER ./input-gram" at_fn_check_prepare_dynamic " $PREPARSER ./input-gram" "skeletons.at:130" ( $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:130" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/skeletons.at:130: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "skeletons.at:130" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:130" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'skeletons.at:142' \ "Boolean=variables: invalid skeleton defaults" " " 5 at_xfail=no ( $as_echo "147. $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:157: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "skeletons.at:157" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 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:157" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'skeletons.at:166' \ "Complaining during macro argument expansion" " " 5 at_xfail=no ( $as_echo "148. $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:195: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y" "skeletons.at:195" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input1.y: warning: foow fubar [-Wother] foow.y:2.3-5.3: warning: foowat fubar [-Wother] input1.y: error: fooc fubar fooc.y:1.1-10.5: error: foocat fubar input1.y: fatal error: foof fubar " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:195" $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:211: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y" "skeletons.at:211" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "foof.y:12.11-100.122: fatal error: foofat fubar " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:211" $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:225: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input3.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input3.y" "skeletons.at:225" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input3.y: fatal error: b4_percent_define_get_loc: undefined %define variable 'bogus' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:225" $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:239: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input4.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input4.y" "skeletons.at:239" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input4.y: fatal error: b4_percent_define_get_syncline: undefined %define variable 'bogus' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:239" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'skeletons.at:248' \ "Fatal errors make M4 exit immediately" " " 5 at_xfail=no ( $as_echo "149. $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:265: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y" "skeletons.at:265" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input1.y: error: non-fatal error input1.y: fatal error: M4 should exit immediately here " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:265" $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:282: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y" "skeletons.at:282" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input2.y: warning: morning [-Wother] foo.y:1.5-6: fatal error: M4 should exit immediately here " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:282" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'skeletons.at:302' \ "Fatal errors but M4 continues producing output" " " 5 at_xfail=no ( $as_echo "150. $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:314: \"\$PERL\" gen-skel.pl > skel.c || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" gen-skel.pl > skel.c || exit 77" "skeletons.at:314" ( $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:314" $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:324: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "skeletons.at:324" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: fatal error: too many arguments for @output directive in skeleton " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:324" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'sets.at:27' \ "Nullable" " " 6 at_xfail=no ( $as_echo "151. $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:42: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --trace=sets input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:42" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:42" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:42: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:42" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:42" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:42: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:42" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:42" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/sets.at:42: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:42" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:42" $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:42: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=sets input.y" at_fn_check_prepare_trace "sets.at:42" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:42" $at_failed && at_fn_log_failure $at_traceon; } cat >extract.sed <<'_ATEOF' #n /^DERIVES/ { :DERIVES p n /^ *$/ !b DERIVES } /^NULLABLE/ { :NULLABL p n /^ *$/ !b NULLABL } /^FIRSTS/ { :FIRSTS p n /^ *$/ !b FIRSTS } /^FDERIVES/ { :FDERIVE p n /^ *$/ !b FDERIVE } _ATEOF { set +x $as_echo "$at_srcdir/sets.at:67: sed -f extract.sed stderr" at_fn_check_prepare_trace "sets.at:67" ( $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 >>"$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: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_151 #AT_START_152 at_fn_group_banner 152 'sets.at:111' \ "Broken Closure" " " 6 at_xfail=no ( $as_echo "152. $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:125: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --trace=sets input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:125" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:125" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:125: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:125" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:125" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:125: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:125" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:125" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/sets.at:125: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:125" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:125" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/sets.at:125: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=sets input.y" at_fn_check_prepare_trace "sets.at:125" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:125" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:143: 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:143" ( $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: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_152 #AT_START_153 at_fn_group_banner 153 'sets.at:153' \ "Firsts" " " 6 at_xfail=no ( $as_echo "153. $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:171: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --trace=sets input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:171" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:171" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:171: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:171" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:171" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:171: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:171" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:171" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/sets.at:171: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:171" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/sets.at:171: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=sets input.y" at_fn_check_prepare_trace "sets.at:171" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=sets input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:171" $at_failed && at_fn_log_failure $at_traceon; } cat >extract.sed <<'_ATEOF' #n /^DERIVES/ { :DERIVES p n /^ *$/ !b DERIVES } /^NULLABLE/ { :NULLABL p n /^ *$/ !b NULLABL } /^FIRSTS/ { :FIRSTS p n /^ *$/ !b FIRSTS } /^FDERIVES/ { :FDERIVE p n /^ *$/ !b FDERIVE } _ATEOF { set +x $as_echo "$at_srcdir/sets.at:211: sed -f extract.sed stderr" at_fn_check_prepare_trace "sets.at:211" ( $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 >>"$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:211" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'sets.at:228' \ "Accept" " " 6 at_xfail=no ( $as_echo "154. $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:240: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:240" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:240" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:240: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "sets.at:240" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:240" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:240: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:240" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:240" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/sets.at:240: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:240" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:240" $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:240: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y" at_fn_check_prepare_trace "sets.at:240" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:240" $at_failed && at_fn_log_failure $at_traceon; } # Get the final state in the parser. { set +x $as_echo "$at_srcdir/sets.at:244: sed -n 's/.*define YYFINAL *\\([0-9][0-9]*\\)/final state \\1/p' input.c" at_fn_check_prepare_trace "sets.at:244" ( $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:244" $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:259: sed -n ' /^State \\(.*\\)/{ s//final state \\1/ x } / accept/{ x p q } ' input.output" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:259" ( $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:259" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'sets.at:269' \ "Build relations" " " 6 at_xfail=no ( $as_echo "155. $at_setup_line: testing $at_desc ..." $at_traceon # The "includes" relation [DeRemer 1982] is between gotos, so of # course, for a given goto, there cannot be more that ngotos (number # of gotos) images. But we manipulate the set of images of a goto as # a list, without checking that an image was not already introduced. # So we can "register" way more images than ngotos, leading to a crash # (heap buffer overflow). # # http://lists.gnu.org/archive/html/bug-bison/2019-03/msg00007.html cat >input.y <<'_ATEOF' %% expr: term | term | term | term | term | term term: 'n' _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/sets.at:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "sets.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/sets.at:303" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:303: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:303" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:303" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/sets.at:303: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:303" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/sets.at:303: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "sets.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr] input.y:2.14-17: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ input.y:2.21-24: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ input.y:2.28-31: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ input.y:2.35-38: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ input.y:2.42-45: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:303" $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/sets.at:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "sets.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/sets.at:303" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr] input.y:2.14-17: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ input.y:2.21-24: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ input.y:2.28-31: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ input.y:2.35-38: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ input.y:2.42-45: warning: rule useless in parser due to conflicts [-Wother] 2 | expr: term | term | term | term | term | term | ^~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/sets.at:303: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "sets.at:303" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:303" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/sets.at:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "sets.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/sets.at:303" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/sets.at:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "sets.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "sets.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:303" $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_155 #AT_START_156 at_fn_group_banner 156 'sets.at:314' \ "Reduced Grammar" " " 6 at_xfail=no ( $as_echo "156. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% expr: expr "+" term | term term: term "*" fact | fact useless: "useless" fact: "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/sets.at:381: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --trace=grammar -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:381" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --trace=grammar -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:381" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:381: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y" "sets.at:381" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:381" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:381: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:381" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:381" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/sets.at:381: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:381" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:381" $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:381: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=grammar -o input.c input.y" at_fn_check_prepare_trace "sets.at:381" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=grammar -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 nonterminal useless in grammar [-Wother] input.y: warning: 1 rule useless in grammar [-Wother] input.y:4.1-7: warning: nonterminal useless in grammar: useless [-Wother] Reduced Grammar ntokens = 7, nvars = 4, nsyms = 11, nrules = 6, nritems = 17 Tokens ------ Value Sprec Sassoc Tag 0 0 0 \$end 1 0 0 error 2 0 0 \$undefined 3 0 0 \"+\" 4 0 0 \"*\" 5 0 0 \"useless\" 6 0 0 \"num\" Non terminals ------------- Value Tag 7 \$accept 8 expr 9 term 10 fact Rules ----- Num (Prec, Assoc, Useful, UselessChain) Lhs -> (Ritem Range) Rhs 0 ( 0, 0, t, f) 7 -> ( 0- 1) 8 0 1 ( 0, 0, t, f) 8 -> ( 3- 5) 8 3 9 2 ( 0, 0, t, t) 8 -> ( 7- 7) 9 3 ( 0, 0, t, f) 9 -> ( 9-11) 9 4 10 4 ( 0, 0, t, t) 9 -> (13-13) 10 5 ( 0, 0, t, t) 10 -> (17-17) 6 6 ( 0, 0, f, t) 11 -> (15-15) 5 Rules interpreted ----------------- 0 \$accept: expr \$end 1 expr: expr \"+\" term 2 expr: term 3 term: term \"*\" fact 4 term: fact 5 fact: \"num\" 6 useless: \"useless\" reduced input.y defines 7 terminals, 4 nonterminals, and 6 productions. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:381" $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/sets.at:381: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Werror" "sets.at:381" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -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/sets.at:381" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 nonterminal useless in grammar [-Wother] input.y: warning: 1 rule useless in grammar [-Wother] input.y:4.1-7: warning: nonterminal useless in grammar: useless [-Wother] Reduced Grammar ntokens = 7, nvars = 4, nsyms = 11, nrules = 6, nritems = 17 Tokens ------ Value Sprec Sassoc Tag 0 0 0 $end 1 0 0 error 2 0 0 $undefined 3 0 0 "+" 4 0 0 "*" 5 0 0 "useless" 6 0 0 "num" Non terminals ------------- Value Tag 7 $accept 8 expr 9 term 10 fact Rules ----- Num (Prec, Assoc, Useful, UselessChain) Lhs -> (Ritem Range) Rhs 0 ( 0, 0, t, f) 7 -> ( 0- 1) 8 0 1 ( 0, 0, t, f) 8 -> ( 3- 5) 8 3 9 2 ( 0, 0, t, t) 8 -> ( 7- 7) 9 3 ( 0, 0, t, f) 9 -> ( 9-11) 9 4 10 4 ( 0, 0, t, t) 9 -> (13-13) 10 5 ( 0, 0, t, t) 10 -> (17-17) 6 6 ( 0, 0, f, t) 11 -> (15-15) 5 Rules interpreted ----------------- 0 $accept: expr $end 1 expr: expr "+" term 2 expr: term 3 term: term "*" fact 4 term: fact 5 fact: "num" 6 useless: "useless" reduced input.y defines 7 terminals, 4 nonterminals, and 6 productions. _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/sets.at:381: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "sets.at:381" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.at:381" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/sets.at:381: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=error" "sets.at:381" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -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/sets.at:381" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/sets.at:381: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Wnone,none -Werror --trace=none" "sets.at:381" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:381" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:381: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=none -Werror --trace=none" "sets.at:381" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:381" $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_156 #AT_START_157 at_fn_group_banner 157 'sets.at:392' \ "Reduced Grammar with prec and assoc" " " 6 at_xfail=no ( $as_echo "157. $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:467: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --trace=grammar -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "sets.at:467" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --trace=grammar -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:467" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/sets.at:467: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y" "sets.at:467" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:467" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/sets.at:467: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:467" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:467" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/sets.at:467: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:467" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:467" $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:467: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=grammar -o input.c input.y" at_fn_check_prepare_trace "sets.at:467" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --trace=grammar -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Reduced Grammar ntokens = 10, nvars = 2, nsyms = 12, nrules = 8, nritems = 29 Tokens ------ Value Sprec Sassoc Tag 0 0 0 \$end 1 0 0 error 2 0 0 \$undefined 3 1 3 '<' 4 1 3 '>' 5 2 2 '+' 6 2 2 '-' 7 3 1 '^' 8 3 1 '=' 9 0 0 \"exp\" Non terminals ------------- Value Tag 10 \$accept 11 exp Rules ----- Num (Prec, Assoc, Useful, UselessChain) Lhs -> (Ritem Range) Rhs 0 ( 0, 0, t, f) 10 -> ( 0- 1) 11 0 1 ( 1, 3, t, f) 11 -> ( 3- 5) 11 3 11 2 ( 1, 3, t, f) 11 -> ( 7- 9) 11 4 11 3 ( 2, 2, t, f) 11 -> (11-13) 11 5 11 4 ( 2, 2, t, f) 11 -> (15-17) 11 6 11 5 ( 3, 1, t, f) 11 -> (19-21) 11 7 11 6 ( 3, 1, t, f) 11 -> (23-25) 11 8 11 7 ( 0, 0, t, t) 11 -> (27-27) 9 Rules interpreted ----------------- 0 \$accept: exp \$end 1 exp: exp '<' exp 2 exp: exp '>' exp 3 exp: exp '+' exp 4 exp: exp '-' exp 5 exp: exp '^' exp 6 exp: exp '=' exp 7 exp: \"exp\" reduced input.y defines 10 terminals, 2 nonterminals, and 8 productions. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/sets.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_157 #AT_START_158 at_fn_group_banner 158 'reduce.at:26' \ "Useless Terminals" " " 7 at_xfail=no ( $as_echo "158. $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:47: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:47" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:47" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:47: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "reduce.at:47" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:47: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:47" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:47" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:47: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:47" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:47" $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:47: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "reduce.at:47" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:60: sed -n '/^Grammar/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:60" ( $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: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_158 #AT_START_159 at_fn_group_banner 159 'reduce.at:70' \ "Useless Nonterminals" " " 7 at_xfail=no ( $as_echo "159. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code { void yyerror (const char *msg); int yylex (void); } %verbose %output "input.c" %token useful %% exp: useful; useless1: useless2: useless3: _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:95: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:95" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:95" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:95: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "reduce.at:95" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:95" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:95: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:95" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:95" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:95: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:95" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:95" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:95: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y" at_fn_check_prepare_trace "reduce.at:95" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 3 nonterminals useless in grammar [-Wother] input.y: warning: 3 rules useless in grammar [-Wother] input.y:11.1-8: warning: nonterminal useless in grammar: useless1 [-Wother] input.y:12.1-8: warning: nonterminal useless in grammar: useless2 [-Wother] input.y:13.1-8: warning: nonterminal useless in grammar: useless3 [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:95" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/reduce.at:95: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "reduce.at:95" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:95" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 3 nonterminals useless in grammar [-Wother] input.y: warning: 3 rules useless in grammar [-Wother] input.y:11.1-8: warning: nonterminal useless in grammar: useless1 [-Wother] input.y:12.1-8: warning: nonterminal useless in grammar: useless2 [-Wother] input.y:13.1-8: warning: nonterminal useless in grammar: useless3 [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/reduce.at:95: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:95" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:95" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:95: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "reduce.at:95" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:95" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/reduce.at:95: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "reduce.at:95" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:95" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:95: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "reduce.at:95" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:95" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:106: sed -n '/^Grammar/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:106" ( $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 Rules useless in grammar 2 useless1: %empty 3 useless2: %empty 4 useless3: %empty " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:106" $at_failed && at_fn_log_failure $at_traceon; } # Make sure the generated parser is correct. $as_echo "reduce.at:109" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:109" { set +x $as_echo "$at_srcdir/reduce.at:109: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "reduce.at:109" ( $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/reduce.at:109" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:120' \ "Useless Rules" " " 7 at_xfail=no ( $as_echo "160. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code { void yyerror (const char *msg); int yylex (void); } %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:176: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:176" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:176: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "reduce.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:176" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:176: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:176" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:176" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:176: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:176" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:176: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "reduce.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 9 nonterminals useless in grammar [-Wother] input.y: warning: 9 rules useless in grammar [-Wother] input.y:10.1-8: warning: nonterminal useless in grammar: useless1 [-Wother] 10 | useless1: '1'; | ^~~~~~~~ input.y:11.1-8: warning: nonterminal useless in grammar: useless2 [-Wother] 11 | useless2: '2'; | ^~~~~~~~ input.y:12.1-8: warning: nonterminal useless in grammar: useless3 [-Wother] 12 | useless3: '3'; | ^~~~~~~~ input.y:13.1-8: warning: nonterminal useless in grammar: useless4 [-Wother] 13 | useless4: '4'; | ^~~~~~~~ input.y:14.1-8: warning: nonterminal useless in grammar: useless5 [-Wother] 14 | useless5: '5'; | ^~~~~~~~ input.y:15.1-8: warning: nonterminal useless in grammar: useless6 [-Wother] 15 | useless6: '6'; | ^~~~~~~~ input.y:16.1-8: warning: nonterminal useless in grammar: useless7 [-Wother] 16 | useless7: '7'; | ^~~~~~~~ input.y:17.1-8: warning: nonterminal useless in grammar: useless8 [-Wother] 17 | useless8: '8'; | ^~~~~~~~ input.y:18.1-8: warning: nonterminal useless in grammar: useless9 [-Wother] 18 | 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:176" $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:176: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "reduce.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:176" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 9 nonterminals useless in grammar [-Wother] input.y: warning: 9 rules useless in grammar [-Wother] input.y:10.1-8: warning: nonterminal useless in grammar: useless1 [-Wother] 10 | useless1: '1'; | ^~~~~~~~ input.y:11.1-8: warning: nonterminal useless in grammar: useless2 [-Wother] 11 | useless2: '2'; | ^~~~~~~~ input.y:12.1-8: warning: nonterminal useless in grammar: useless3 [-Wother] 12 | useless3: '3'; | ^~~~~~~~ input.y:13.1-8: warning: nonterminal useless in grammar: useless4 [-Wother] 13 | useless4: '4'; | ^~~~~~~~ input.y:14.1-8: warning: nonterminal useless in grammar: useless5 [-Wother] 14 | useless5: '5'; | ^~~~~~~~ input.y:15.1-8: warning: nonterminal useless in grammar: useless6 [-Wother] 15 | useless6: '6'; | ^~~~~~~~ input.y:16.1-8: warning: nonterminal useless in grammar: useless7 [-Wother] 16 | useless7: '7'; | ^~~~~~~~ input.y:17.1-8: warning: nonterminal useless in grammar: useless8 [-Wother] 17 | useless8: '8'; | ^~~~~~~~ input.y:18.1-8: warning: nonterminal useless in grammar: useless9 [-Wother] 18 | useless9: '9'; | ^~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/reduce.at:176: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:176" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:176" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:176: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "reduce.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:176" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/reduce.at:176: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "reduce.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:176" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:176: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "reduce.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:176" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:210: sed -n '/^Grammar/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:210" ( $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:210" $at_failed && at_fn_log_failure $at_traceon; } # Make sure the generated parser is correct. $as_echo "reduce.at:213" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:213" { set +x $as_echo "$at_srcdir/reduce.at:213: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "reduce.at:213" ( $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/reduce.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_160 #AT_START_161 at_fn_group_banner 161 'reduce.at:224' \ "Useless Parts" " " 7 at_xfail=no ( $as_echo "161. $at_setup_line: testing $at_desc ..." $at_traceon # We used to emit code that used symbol numbers before the useless # symbol elimination, hence before the renumbering of the useful # symbols. As a result, the evaluation of the skeleton failed because # it used non existing symbol numbers. Which is the happy scenario: # we could use numbers of other existing symbols... # http://lists.gnu.org/archive/html/bug-bison/2019-01/msg00044.html cat >input.y <<'_ATEOF' %code { void yyerror (const char *msg); int yylex (void); } %union { void* ptr; } %type used1 %type used2 %% start : used1 ; used1 : used2 { $$ = $1; } ; unused : used2 ; used2 : { $$ = YY_NULLPTR; } ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:267: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -rall -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:267" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -rall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:267" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:267: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -rall -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -rall -o input.c input.y" "reduce.at:267" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -rall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:267" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:267: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:267" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:267" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:267: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:267" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:267" $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:267: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y" at_fn_check_prepare_trace "reduce.at:267" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 nonterminal useless in grammar [-Wother] input.y: warning: 1 rule useless in grammar [-Wother] input.y:18.1-6: warning: nonterminal useless in grammar: unused [-Wother] 18 | unused | ^~~~~~ " | \ $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:267" $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:267: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Werror" "reduce.at:267" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:267" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 nonterminal useless in grammar [-Wother] input.y: warning: 1 rule useless in grammar [-Wother] input.y:18.1-6: warning: nonterminal useless in grammar: unused [-Wother] 18 | unused | ^~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/reduce.at:267: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:267" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:267" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:267: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=error" "reduce.at:267" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:267" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/reduce.at:267: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Wnone,none -Werror --trace=none" "reduce.at:267" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:267" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:267: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=none -Werror --trace=none" "reduce.at:267" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:267" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:295: sed -n '/^State 0/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0/q;/^$/!p' input.output" "reduce.at:295" ( $at_check_trace; sed -n '/^State 0/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 unused Rules useless in grammar 4 unused: used2 Grammar 0 \$accept: start \$end 1 start: used1 2 used1: used2 3 used2: %empty Terminals, with rules where they appear \$end (0) 0 error (256) Nonterminals, with rules where they appear \$accept (3) on left: 0 start (4) on left: 1 on right: 0 used1 (5) on left: 2 on right: 1 used2 (6) on left: 3 on right: 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:295" $at_failed && at_fn_log_failure $at_traceon; } # Make sure the generated parser is correct. $as_echo "reduce.at:298" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:298" { set +x $as_echo "$at_srcdir/reduce.at:298: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "reduce.at:298" ( $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/reduce.at:298" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:312' \ "Reduced Automaton" " " 7 at_xfail=no ( $as_echo "162. $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:353: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret not-reduced.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:353" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:353" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:353: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret not-reduced.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret not-reduced.y" "reduce.at:353" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret not-reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:353" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:353: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:353" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:353" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:353: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:353" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:353" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:353: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret not-reduced.y" at_fn_check_prepare_trace "reduce.at:353" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret not-reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "not-reduced.y: warning: 2 nonterminals useless in grammar [-Wother] not-reduced.y: warning: 3 rules useless in grammar [-Wother] not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable [-Wother] 14 | not_reachable: useful { /* A not reachable action. */ } | ^~~~~~~~~~~~~ not-reduced.y:17.1-14: warning: nonterminal useless in grammar: non_productive [-Wother] 17 | non_productive: non_productive useless_token | ^~~~~~~~~~~~~~ not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother] 11 | | non_productive { /* A non productive action. */ } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ " | \ $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:353" $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:353: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Werror" "reduce.at:353" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:353" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' not-reduced.y: warning: 2 nonterminals useless in grammar [-Wother] not-reduced.y: warning: 3 rules useless in grammar [-Wother] not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable [-Wother] 14 | not_reachable: useful { /* A not reachable action. */ } | ^~~~~~~~~~~~~ not-reduced.y:17.1-14: warning: nonterminal useless in grammar: non_productive [-Wother] 17 | non_productive: non_productive useless_token | ^~~~~~~~~~~~~~ not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother] 11 | | non_productive { /* A non productive action. */ } | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/reduce.at:353: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:353" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:353" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:353: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=error" "reduce.at:353" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:353" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/reduce.at:353: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Wnone,none -Werror --trace=none" "reduce.at:353" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:353" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:353: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=none -Werror --trace=none" "reduce.at:353" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:353" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:365: sed -n '/^Grammar/q;/^\$/!p' not-reduced.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' not-reduced.output" "reduce.at:365" ( $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:365" $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:392: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv reduced.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:392" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:392" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:392: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml reduced.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml reduced.y" "reduce.at:392" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:392" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:392: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:392" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:392" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:392: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:392" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:392" $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:392: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret reduced.y" at_fn_check_prepare_trace "reduce.at:392" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret reduced.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:392" $at_failed && at_fn_log_failure $at_traceon; } # Comparing the parsers. cp reduced.c expout { set +x $as_echo "$at_srcdir/reduce.at:396: sed 's/not-reduced/reduced/g' not-reduced.c" at_fn_check_prepare_trace "reduce.at:396" ( $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:396" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:406' \ "Underivable Rules" " " 7 at_xfail=no ( $as_echo "163. $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:432: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:432" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:432" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:432: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "reduce.at:432" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:432" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:432: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:432" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:432" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:432: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:432" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:432" $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:432: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y" at_fn_check_prepare_trace "reduce.at:432" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar [-Wother] input.y: warning: 3 rules useless in grammar [-Wother] input.y:6.1-11: warning: nonterminal useless in grammar: underivable [-Wother] 6 | underivable: indirection; | ^~~~~~~~~~~ input.y:7.1-11: warning: nonterminal useless in grammar: indirection [-Wother] 7 | indirection: underivable; | ^~~~~~~~~~~ input.y:5.15-25: warning: rule useless in grammar [-Wother] 5 | exp: useful | 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:432" $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:432: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "reduce.at:432" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:432" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 2 nonterminals useless in grammar [-Wother] input.y: warning: 3 rules useless in grammar [-Wother] input.y:6.1-11: warning: nonterminal useless in grammar: underivable [-Wother] 6 | underivable: indirection; | ^~~~~~~~~~~ input.y:7.1-11: warning: nonterminal useless in grammar: indirection [-Wother] 7 | indirection: underivable; | ^~~~~~~~~~~ input.y:5.15-25: warning: rule useless in grammar [-Wother] 5 | exp: useful | underivable; | ^~~~~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/reduce.at:432: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:432" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:432" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:432: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "reduce.at:432" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:432" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/reduce.at:432: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "reduce.at:432" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:432" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:432: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "reduce.at:432" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:432" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:442: sed -n '/^Grammar/q;/^\$/!p' input.output" at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:442" ( $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:442" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_163 #AT_START_164 at_fn_group_banner 164 'reduce.at:452' \ "Empty Language" " " 7 at_xfail=no ( $as_echo "164. $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:464: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "reduce.at:464" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 2 nonterminals useless in grammar [-Wother] input.y: warning: 2 rules useless in grammar [-Wother] input.y:3.1-3: fatal error: start symbol exp does not derive any sentence " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:464" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:734' \ "no lr.type: Single State Split" " " 7 at_xfail=no ( $as_echo "165. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; /* A conflict should appear after the first 'a' in rules 4 and 5 but only after having shifted the first 'a' in rule 1. However, when LALR(1) merging is chosen, the state containing that conflict is reused after having seen the first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases, because of the merged state, if the next token is an 'a', the %left forces a reduction action with rule 5. In the latter case, only a shift is actually grammatically correct. Thus, the parser would report a syntax error for the grammatically correct sentence "baab" because it would encounter a syntax error after that incorrect reduction. Despite not being LALR(1), Menhir version 20070322 suffers from this problem as well. It uses David Pager's weak compatibility test for merging states. Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager designed his algorithm only for LR(1) grammars. */ A: 'a' 'a' /* rule 4 */ | 'a' /* rule 5 */ ; /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as useless after conflict resolution. This proves that, even though LALR(1) generates incorrect parser tables sometimes, Bison will not necessarily produce any warning to help the user realize it. */ c: 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:734" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:734: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:734" ( $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:734" $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. $as_echo "reduce.at:734" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:734" { set +x $as_echo "$at_srcdir/reduce.at:734: \$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:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:734" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:734" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:734' \ "lr.type=lalr: Single State Split" " " 7 at_xfail=no ( $as_echo "166. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; /* A conflict should appear after the first 'a' in rules 4 and 5 but only after having shifted the first 'a' in rule 1. However, when LALR(1) merging is chosen, the state containing that conflict is reused after having seen the first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases, because of the merged state, if the next token is an 'a', the %left forces a reduction action with rule 5. In the latter case, only a shift is actually grammatically correct. Thus, the parser would report a syntax error for the grammatically correct sentence "baab" because it would encounter a syntax error after that incorrect reduction. Despite not being LALR(1), Menhir version 20070322 suffers from this problem as well. It uses David Pager's weak compatibility test for merging states. Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager designed his algorithm only for LR(1) grammars. */ A: 'a' 'a' /* rule 4 */ | 'a' /* rule 5 */ ; /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as useless after conflict resolution. This proves that, even though LALR(1) generates incorrect parser tables sometimes, Bison will not necessarily produce any warning to help the user realize it. */ c: 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:734" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:734: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:734" ( $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:734" $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. $as_echo "reduce.at:734" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:734" { set +x $as_echo "$at_srcdir/reduce.at:734: \$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:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:734" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:734" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:734' \ "lr.type=ielr: Single State Split" " " 7 at_xfail=no ( $as_echo "167. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; /* A conflict should appear after the first 'a' in rules 4 and 5 but only after having shifted the first 'a' in rule 1. However, when LALR(1) merging is chosen, the state containing that conflict is reused after having seen the first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases, because of the merged state, if the next token is an 'a', the %left forces a reduction action with rule 5. In the latter case, only a shift is actually grammatically correct. Thus, the parser would report a syntax error for the grammatically correct sentence "baab" because it would encounter a syntax error after that incorrect reduction. Despite not being LALR(1), Menhir version 20070322 suffers from this problem as well. It uses David Pager's weak compatibility test for merging states. Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager designed his algorithm only for LR(1) grammars. */ A: 'a' 'a' /* rule 4 */ | 'a' /* rule 5 */ ; /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as useless after conflict resolution. This proves that, even though LALR(1) generates incorrect parser tables sometimes, Bison will not necessarily produce any warning to help the user realize it. */ c: 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:734" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:734: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:734" ( $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:734" $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. $as_echo "reduce.at:734" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:734" { set +x $as_echo "$at_srcdir/reduce.at:734: \$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:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:734" ( $at_check_trace; 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:734" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:734' \ "lr.type=canonical-lr: Single State Split" " " 7 at_xfail=no ( $as_echo "168. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; /* A conflict should appear after the first 'a' in rules 4 and 5 but only after having shifted the first 'a' in rule 1. However, when LALR(1) merging is chosen, the state containing that conflict is reused after having seen the first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases, because of the merged state, if the next token is an 'a', the %left forces a reduction action with rule 5. In the latter case, only a shift is actually grammatically correct. Thus, the parser would report a syntax error for the grammatically correct sentence "baab" because it would encounter a syntax error after that incorrect reduction. Despite not being LALR(1), Menhir version 20070322 suffers from this problem as well. It uses David Pager's weak compatibility test for merging states. Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager designed his algorithm only for LR(1) grammars. */ A: 'a' 'a' /* rule 4 */ | 'a' /* rule 5 */ ; /* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as useless after conflict resolution. This proves that, even though LALR(1) generates incorrect parser tables sometimes, Bison will not necessarily produce any warning to help the user realize it. */ c: 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:734" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:734: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:734" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:734: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:734" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:734" ( $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:734" $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 $as_echo "reduce.at:734" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:734" { set +x $as_echo "$at_srcdir/reduce.at:734: \$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:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:734: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:734" ( $at_check_trace; 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:734" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:978' \ "no lr.type: Lane Split" " " 7 at_xfail=no ( $as_echo "169. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% /* Similar to the last test case set but two states must be split. */ S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; A: 'a' 'a' 'a' /* rule 4 */ | 'a' 'a' /* rule 5 */ ; c: 'a' 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:978: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:978: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:978" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:978" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:978: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:978" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:978" $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:978: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:978" ( $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:978" $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. $as_echo "reduce.at:978" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:978" { set +x $as_echo "$at_srcdir/reduce.at:978: \$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:978" ( $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:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:978" ( $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:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:978" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:978" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:978' \ "lr.type=lalr: Lane Split" " " 7 at_xfail=no ( $as_echo "170. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% /* Similar to the last test case set but two states must be split. */ S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; A: 'a' 'a' 'a' /* rule 4 */ | 'a' 'a' /* rule 5 */ ; c: 'a' 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:978: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:978: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:978" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:978" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:978: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:978" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:978" $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:978: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:978" ( $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:978" $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. $as_echo "reduce.at:978" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:978" { set +x $as_echo "$at_srcdir/reduce.at:978: \$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:978" ( $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:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:978" ( $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:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:978" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:978" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:978' \ "lr.type=ielr: Lane Split" " " 7 at_xfail=no ( $as_echo "171. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% /* Similar to the last test case set but two states must be split. */ S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; A: 'a' 'a' 'a' /* rule 4 */ | 'a' 'a' /* rule 5 */ ; c: 'a' 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:978: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:978: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:978" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:978" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:978: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:978" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:978" $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:978: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:978" ( $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:978" $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. $as_echo "reduce.at:978" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:978" { set +x $as_echo "$at_srcdir/reduce.at:978: \$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:978" ( $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:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:978" ( $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:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:978" ( $at_check_trace; 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:978" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:978' \ "lr.type=canonical-lr: Lane Split" " " 7 at_xfail=no ( $as_echo "172. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% /* Similar to the last test case set but two states must be split. */ S: 'a' A 'a' /* rule 1 */ | 'b' A 'b' /* rule 2 */ | 'c' c /* rule 3 */ ; A: 'a' 'a' 'a' /* rule 4 */ | 'a' 'a' /* rule 5 */ ; c: 'a' 'a' 'b' /* rule 6 */ | A /* rule 7 */ ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:978: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:978: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:978" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:978" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:978: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:978" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:978" $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:978: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:978" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:978" ( $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:978" $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 $as_echo "reduce.at:978" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:978" { set +x $as_echo "$at_srcdir/reduce.at:978: \$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:978" ( $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:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:978" ( $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:978" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:978: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:978" ( $at_check_trace; 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:978" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:1247' \ "no lr.type: Complex Lane Split" " " 7 at_xfail=no ( $as_echo "173. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% /* Similar to the last test case set but forseeing the S/R conflict from the first state that must be split is becoming difficult. Imagine if B were even more complex. Imagine if A had other RHS's ending in other nonterminals. */ S: 'a' A 'a' | 'b' A 'b' | 'c' c ; A: 'a' 'a' B ; B: 'a' | %empty %prec 'a' ; c: 'a' 'a' 'b' | A ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1247: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1247: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1247" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1247" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1247: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1247" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:1247: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1247" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' B 7 c: . 'a' 'a' 'b' 8 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' B 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' B 7 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 8 c: A . \$default reduce using rule 8 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty ['a', 'b'] \$default reduce using rule 6 (B) B go to state 17 Conflict between rule 6 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty [\$end] 7 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 18 \$default reduce using rule 6 (B) B go to state 17 State 16 5 B: 'a' . \$default reduce using rule 5 (B) State 17 4 A: 'a' 'a' B . \$default reduce using rule 4 (A) State 18 7 c: 'a' 'a' 'b' . \$default reduce using rule 7 (c) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $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. $as_echo "reduce.at:1247" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1247" { set +x $as_echo "$at_srcdir/reduce.at:1247: \$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:1247" ( $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:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1247" ( $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:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1247" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: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_173 #AT_START_174 at_fn_group_banner 174 'reduce.at:1247' \ "lr.type=lalr: Complex Lane Split" " " 7 at_xfail=no ( $as_echo "174. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% /* Similar to the last test case set but forseeing the S/R conflict from the first state that must be split is becoming difficult. Imagine if B were even more complex. Imagine if A had other RHS's ending in other nonterminals. */ S: 'a' A 'a' | 'b' A 'b' | 'c' c ; A: 'a' 'a' B ; B: 'a' | %empty %prec 'a' ; c: 'a' 'a' 'b' | A ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1247: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1247: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1247" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1247" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1247: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1247" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:1247: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1247" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' B 7 c: . 'a' 'a' 'b' 8 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' B 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' B 7 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 8 c: A . \$default reduce using rule 8 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty ['a', 'b'] \$default reduce using rule 6 (B) B go to state 17 Conflict between rule 6 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty [\$end] 7 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 18 \$default reduce using rule 6 (B) B go to state 17 State 16 5 B: 'a' . \$default reduce using rule 5 (B) State 17 4 A: 'a' 'a' B . \$default reduce using rule 4 (A) State 18 7 c: 'a' 'a' 'b' . \$default reduce using rule 7 (c) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $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. $as_echo "reduce.at:1247" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1247" { set +x $as_echo "$at_srcdir/reduce.at:1247: \$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:1247" ( $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:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1247" ( $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:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1247" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: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_174 #AT_START_175 at_fn_group_banner 175 'reduce.at:1247' \ "lr.type=ielr: Complex Lane Split" " " 7 at_xfail=no ( $as_echo "175. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% /* Similar to the last test case set but forseeing the S/R conflict from the first state that must be split is becoming difficult. Imagine if B were even more complex. Imagine if A had other RHS's ending in other nonterminals. */ S: 'a' A 'a' | 'b' A 'b' | 'c' c ; A: 'a' 'a' B ; B: 'a' | %empty %prec 'a' ; c: 'a' 'a' 'b' | A ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1247: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1247: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1247" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1247" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1247: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1247" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:1247: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1247" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' B 'a' shift, and go to state 19 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' B 7 c: . 'a' 'a' 'b' 8 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' B 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' B 7 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 8 c: A . \$default reduce using rule 8 (c) State 10 3 S: 'c' c . \$default reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty ['a'] \$default reduce using rule 6 (B) B go to state 17 Conflict between rule 6 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . \$default reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . \$default reduce using rule 2 (S) State 15 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty [\$end] 7 c: 'a' 'a' . 'b' 'a' shift, and go to state 16 'b' shift, and go to state 18 \$default reduce using rule 6 (B) B go to state 17 State 16 5 B: 'a' . \$default reduce using rule 5 (B) State 17 4 A: 'a' 'a' B . \$default reduce using rule 4 (A) State 18 7 c: 'a' 'a' 'b' . \$default reduce using rule 7 (c) State 19 4 A: 'a' . 'a' B 'a' shift, and go to state 20 State 20 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty ['b'] 'a' shift, and go to state 16 \$default reduce using rule 6 (B) B go to state 17 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $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. $as_echo "reduce.at:1247" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1247" { set +x $as_echo "$at_srcdir/reduce.at:1247: \$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:1247" ( $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:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1247" ( $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:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1247" ( $at_check_trace; 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: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_175 #AT_START_176 at_fn_group_banner 176 'reduce.at:1247' \ "lr.type=canonical-lr: Complex Lane Split" " " 7 at_xfail=no ( $as_echo "176. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 parser table diff is easier to code. %define lr.keep-unreachable-state %% /* Similar to the last test case set but forseeing the S/R conflict from the first state that must be split is becoming difficult. Imagine if B were even more complex. Imagine if A had other RHS's ending in other nonterminals. */ S: 'a' A 'a' | 'b' A 'b' | 'c' c ; A: 'a' 'a' B ; B: 'a' | %empty %prec 'a' ; c: 'a' 'a' 'b' | A ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'a', 'a', 'a', 'b', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1247: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1247: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1247" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1247" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1247: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1247" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/reduce.at:1247: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1247" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1247" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . S \$end 1 S: . 'a' A 'a' 2 | . 'b' A 'b' 3 | . 'c' c 'a' shift, and go to state 1 'b' shift, and go to state 2 'c' shift, and go to state 3 S go to state 4 State 1 1 S: 'a' . A 'a' 4 A: . 'a' 'a' B 'a' shift, and go to state 5 A go to state 6 State 2 2 S: 'b' . A 'b' 4 A: . 'a' 'a' B 'a' shift, and go to state 19 A go to state 7 State 3 3 S: 'c' . c 4 A: . 'a' 'a' B 7 c: . 'a' 'a' 'b' 8 | . A 'a' shift, and go to state 8 A go to state 9 c go to state 10 State 4 0 \$accept: S . \$end \$end shift, and go to state 11 State 5 4 A: 'a' . 'a' B 'a' shift, and go to state 12 State 6 1 S: 'a' A . 'a' 'a' shift, and go to state 13 State 7 2 S: 'b' A . 'b' 'b' shift, and go to state 14 State 8 4 A: 'a' . 'a' B 7 c: 'a' . 'a' 'b' 'a' shift, and go to state 15 State 9 8 c: A . [\$end] \$end reduce using rule 8 (c) State 10 3 S: 'c' c . [\$end] \$end reduce using rule 3 (S) State 11 0 \$accept: S \$end . \$default accept State 12 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty ['a'] 'a' reduce using rule 6 (B) B go to state 17 Conflict between rule 6 and token 'a' resolved as reduce (%left 'a'). State 13 1 S: 'a' A 'a' . [\$end] \$end reduce using rule 1 (S) State 14 2 S: 'b' A 'b' . [\$end] \$end reduce using rule 2 (S) State 15 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty [\$end] 7 c: 'a' 'a' . 'b' 'a' shift, and go to state 20 'b' shift, and go to state 18 \$end reduce using rule 6 (B) B go to state 21 State 16 5 B: 'a' . ['a'] 'a' reduce using rule 5 (B) State 17 4 A: 'a' 'a' B . ['a'] 'a' reduce using rule 4 (A) State 18 7 c: 'a' 'a' 'b' . [\$end] \$end reduce using rule 7 (c) State 19 4 A: 'a' . 'a' B 'a' shift, and go to state 22 State 20 5 B: 'a' . [\$end] \$end reduce using rule 5 (B) State 21 4 A: 'a' 'a' B . [\$end] \$end reduce using rule 4 (A) State 22 4 A: 'a' 'a' . B 5 B: . 'a' 6 | . %empty ['b'] 'a' shift, and go to state 23 'b' reduce using rule 6 (B) B go to state 24 State 23 5 B: 'a' . ['b'] 'b' reduce using rule 5 (B) State 24 4 A: 'a' 'a' B . ['b'] 'b' reduce using rule 4 (A) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1247" $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 $as_echo "reduce.at:1247" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1247" { set +x $as_echo "$at_srcdir/reduce.at:1247: \$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:1247" ( $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:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1247" ( $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:1247" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1247: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1247" ( $at_check_trace; 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: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_176 #AT_START_177 at_fn_group_banner 177 'reduce.at:1549' \ "no lr.type: Split During Added Lookahead Propagation" "" 7 at_xfail=no ( $as_echo "177. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.keep-unreachable-state %% /* The partial state chart diagram below is for LALR(1). State 0 is the start state. States are iterated for successor construction in numerical order. Transitions are downwards. State 13 has a R/R conflict that cannot be predicted by Bison's LR(1) algorithm using annotations alone. That is, when state 11's successor on 'd' is merged with state 5 (which is originally just state 1's successor on 'd'), state 5's successor on 'e' must then be changed because the resulting lookaheads that propagate to it now make it incompatible with state 8's successor on 'e'. In other words, state 13 must be split to avoid the conflict. 0 / | \ a / c| \ b 1 3 2 | | | d| |c | d | 11 | | | | \ /d | 5 8 \ | e \ / e 13 R/R This grammar is designed carefully to make sure that, despite Bison's LR(1) algorithm's bread-first iteration of transitions to reconstruct states, state 11's successors are constructed after state 5's and state 8's. Otherwise (for example, if you remove the first 'c' in each of rules 6 and 7), state 5's successor on 'e' would never be merged with state 8's, so the split of the resulting state 13 would never need to be performed. */ S: 'a' A 'f' | 'a' B | 'b' A 'f' | 'b' B 'g' | 'b' 'd' | 'c' 'c' A 'g' | 'c' 'c' B ; A: 'd' 'e' ; B: 'd' 'e' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'd', 'e', 'g', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $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:1549: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $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:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/reduce.at:1549: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:1549" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1549: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1549" ( $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:1549" $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. $as_echo "reduce.at:1549" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1549" { set +x $as_echo "$at_srcdir/reduce.at:1549: \$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:1549" ( $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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1549" ( $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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1549" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1549" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:1549' \ "lr.type=lalr: Split During Added Lookahead Propagation" "" 7 at_xfail=no ( $as_echo "178. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type lalr %define lr.keep-unreachable-state %% /* The partial state chart diagram below is for LALR(1). State 0 is the start state. States are iterated for successor construction in numerical order. Transitions are downwards. State 13 has a R/R conflict that cannot be predicted by Bison's LR(1) algorithm using annotations alone. That is, when state 11's successor on 'd' is merged with state 5 (which is originally just state 1's successor on 'd'), state 5's successor on 'e' must then be changed because the resulting lookaheads that propagate to it now make it incompatible with state 8's successor on 'e'. In other words, state 13 must be split to avoid the conflict. 0 / | \ a / c| \ b 1 3 2 | | | d| |c | d | 11 | | | | \ /d | 5 8 \ | e \ / e 13 R/R This grammar is designed carefully to make sure that, despite Bison's LR(1) algorithm's bread-first iteration of transitions to reconstruct states, state 11's successors are constructed after state 5's and state 8's. Otherwise (for example, if you remove the first 'c' in each of rules 6 and 7), state 5's successor on 'e' would never be merged with state 8's, so the split of the resulting state 13 would never need to be performed. */ S: 'a' A 'f' | 'a' B | 'b' A 'f' | 'b' B 'g' | 'b' 'd' | 'c' 'c' A 'g' | 'c' 'c' B ; A: 'd' 'e' ; B: 'd' 'e' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'd', 'e', 'g', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $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:1549: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $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:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/reduce.at:1549: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:1549" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/reduce.at:1549: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1549" ( $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:1549" $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. $as_echo "reduce.at:1549" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1549" { set +x $as_echo "$at_srcdir/reduce.at:1549: \$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:1549" ( $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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1549" ( $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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1549" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1549" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:1549' \ "lr.type=ielr: Split During Added Lookahead Propagation" "" 7 at_xfail=no ( $as_echo "179. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type ielr %define lr.keep-unreachable-state %% /* The partial state chart diagram below is for LALR(1). State 0 is the start state. States are iterated for successor construction in numerical order. Transitions are downwards. State 13 has a R/R conflict that cannot be predicted by Bison's LR(1) algorithm using annotations alone. That is, when state 11's successor on 'd' is merged with state 5 (which is originally just state 1's successor on 'd'), state 5's successor on 'e' must then be changed because the resulting lookaheads that propagate to it now make it incompatible with state 8's successor on 'e'. In other words, state 13 must be split to avoid the conflict. 0 / | \ a / c| \ b 1 3 2 | | | d| |c | d | 11 | | | | \ /d | 5 8 \ | e \ / e 13 R/R This grammar is designed carefully to make sure that, despite Bison's LR(1) algorithm's bread-first iteration of transitions to reconstruct states, state 11's successors are constructed after state 5's and state 8's. Otherwise (for example, if you remove the first 'c' in each of rules 6 and 7), state 5's successor on 'e' would never be merged with state 8's, so the split of the resulting state 13 would never need to be performed. */ S: 'a' A 'f' | 'a' B | 'b' A 'f' | 'b' B 'g' | 'b' 'd' | 'c' 'c' A 'g' | 'c' 'c' B ; A: 'd' 'e' ; B: 'd' 'e' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'd', 'e', 'g', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $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:1549: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1549" ( $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:1549" $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. $as_echo "reduce.at:1549" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1549" { set +x $as_echo "$at_srcdir/reduce.at:1549: \$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:1549" ( $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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1549" ( $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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1549" ( $at_check_trace; 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:1549" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:1549' \ "lr.type=canonical-lr: Split During Added Lookahead Propagation" "" 7 at_xfail=no ( $as_echo "180. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type canonical-lr %define lr.keep-unreachable-state %% /* The partial state chart diagram below is for LALR(1). State 0 is the start state. States are iterated for successor construction in numerical order. Transitions are downwards. State 13 has a R/R conflict that cannot be predicted by Bison's LR(1) algorithm using annotations alone. That is, when state 11's successor on 'd' is merged with state 5 (which is originally just state 1's successor on 'd'), state 5's successor on 'e' must then be changed because the resulting lookaheads that propagate to it now make it incompatible with state 8's successor on 'e'. In other words, state 13 must be split to avoid the conflict. 0 / | \ a / c| \ b 1 3 2 | | | d| |c | d | 11 | | | | \ /d | 5 8 \ | e \ / e 13 R/R This grammar is designed carefully to make sure that, despite Bison's LR(1) algorithm's bread-first iteration of transitions to reconstruct states, state 11's successors are constructed after state 5's and state 8's. Otherwise (for example, if you remove the first 'c' in each of rules 6 and 7), state 5's successor on 'e' would never be merged with state 8's, so the split of the resulting state 13 would never need to be performed. */ S: 'a' A 'f' | 'a' B | 'b' A 'f' | 'b' B 'g' | 'b' 'd' | 'c' 'c' A 'g' | 'c' 'c' B ; A: 'd' 'e' ; B: 'd' 'e' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'b', 'd', 'e', 'g', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1549" $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:1549: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1549" ( $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:1549" $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 $as_echo "reduce.at:1549" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1549" { set +x $as_echo "$at_srcdir/reduce.at:1549: \$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:1549" ( $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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1549" ( $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:1549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1549: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1549" ( $at_check_trace; 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:1549" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:1694' \ "no lr.default-reduction" " " 7 at_xfail=no ( $as_echo "181. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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: %empty; c: %empty; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'a', 'a', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $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:1694: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1694" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . a b 2 | . a b 'a' 3 | . a c 'b' 4 a: . 'a' 'a' shift, and go to state 1 start go to state 2 a go to state 3 State 1 4 a: 'a' . \$default reduce using rule 4 (a) State 2 0 \$accept: start . \$end \$end shift, and go to state 4 State 3 1 start: a . b 2 | a . b 'a' 3 | a . c 'b' 5 b: . %empty [\$end, 'a'] 6 c: . %empty ['b'] 'b' reduce using rule 6 (c) \$default reduce using rule 5 (b) b go to state 5 c go to state 6 State 4 0 \$accept: start \$end . \$default accept State 5 1 start: a b . [\$end] 2 | a b . 'a' 'a' shift, and go to state 7 \$default reduce using rule 1 (start) State 6 3 start: a c . 'b' 'b' shift, and go to state 8 State 7 2 start: a b 'a' . \$default reduce using rule 2 (start) State 8 3 start: a c 'b' . \$default reduce using rule 3 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $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. $as_echo "reduce.at:1694" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1694" { set +x $as_echo "$at_srcdir/reduce.at:1694: \$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:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1694" ( $at_check_trace; 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:1694" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:1694' \ "lr.default-reduction=most" " " 7 at_xfail=no ( $as_echo "182. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.default-reduction most %% /* The start state is consistent and has a shift on 'a' and no reductions. After pushing the b below, enter an inconsistent state that has a shift and one reduction with one lookahead. */ start: a b | a b 'a' | a c 'b' ; /* After shifting this 'a', enter a consistent state that has no shift and 1 reduction with multiple lookaheads. */ a: 'a' ; /* After the previous reduction, enter an inconsistent state that has no shift and multiple reductions. The first reduction has more lookaheads than the second, so the first should always be preferred as the default reduction if enabled. The second reduction has one lookahead. */ b: %empty; c: %empty; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'a', 'a', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $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:1694: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1694" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . a b 2 | . a b 'a' 3 | . a c 'b' 4 a: . 'a' 'a' shift, and go to state 1 start go to state 2 a go to state 3 State 1 4 a: 'a' . \$default reduce using rule 4 (a) State 2 0 \$accept: start . \$end \$end shift, and go to state 4 State 3 1 start: a . b 2 | a . b 'a' 3 | a . c 'b' 5 b: . %empty [\$end, 'a'] 6 c: . %empty ['b'] 'b' reduce using rule 6 (c) \$default reduce using rule 5 (b) b go to state 5 c go to state 6 State 4 0 \$accept: start \$end . \$default accept State 5 1 start: a b . [\$end] 2 | a b . 'a' 'a' shift, and go to state 7 \$default reduce using rule 1 (start) State 6 3 start: a c . 'b' 'b' shift, and go to state 8 State 7 2 start: a b 'a' . \$default reduce using rule 2 (start) State 8 3 start: a c 'b' . \$default reduce using rule 3 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $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. $as_echo "reduce.at:1694" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1694" { set +x $as_echo "$at_srcdir/reduce.at:1694: \$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:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1694" ( $at_check_trace; 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:1694" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:1694' \ "lr.default-reduction=consistent" " " 7 at_xfail=no ( $as_echo "183. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.default-reduction consistent %% /* The start state is consistent and has a shift on 'a' and no reductions. After pushing the b below, enter an inconsistent state that has a shift and one reduction with one lookahead. */ start: a b | a b 'a' | a c 'b' ; /* After shifting this 'a', enter a consistent state that has no shift and 1 reduction with multiple lookaheads. */ a: 'a' ; /* After the previous reduction, enter an inconsistent state that has no shift and multiple reductions. The first reduction has more lookaheads than the second, so the first should always be preferred as the default reduction if enabled. The second reduction has one lookahead. */ b: %empty; c: %empty; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'a', 'a', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $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:1694: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1694" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . a b 2 | . a b 'a' 3 | . a c 'b' 4 a: . 'a' 'a' shift, and go to state 1 start go to state 2 a go to state 3 State 1 4 a: 'a' . \$default reduce using rule 4 (a) State 2 0 \$accept: start . \$end \$end shift, and go to state 4 State 3 1 start: a . b 2 | a . b 'a' 3 | a . c 'b' 5 b: . %empty [\$end, 'a'] 6 c: . %empty ['b'] \$end reduce using rule 5 (b) 'a' reduce using rule 5 (b) 'b' reduce using rule 6 (c) b go to state 5 c go to state 6 State 4 0 \$accept: start \$end . \$default accept State 5 1 start: a b . [\$end] 2 | a b . 'a' 'a' shift, and go to state 7 \$end reduce using rule 1 (start) State 6 3 start: a c . 'b' 'b' shift, and go to state 8 State 7 2 start: a b 'a' . \$default reduce using rule 2 (start) State 8 3 start: a c 'b' . \$default reduce using rule 3 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $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. $as_echo "reduce.at:1694" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1694" { set +x $as_echo "$at_srcdir/reduce.at:1694: \$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:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1694" ( $at_check_trace; 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:1694" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'reduce.at:1694' \ "lr.default-reduction=accepting" " " 7 at_xfail=no ( $as_echo "184. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.default-reduction accepting %% /* The start state is consistent and has a shift on 'a' and no reductions. After pushing the b below, enter an inconsistent state that has a shift and one reduction with one lookahead. */ start: a b | a b 'a' | a c 'b' ; /* After shifting this 'a', enter a consistent state that has no shift and 1 reduction with multiple lookaheads. */ a: 'a' ; /* After the previous reduction, enter an inconsistent state that has no shift and multiple reductions. The first reduction has more lookaheads than the second, so the first should always be preferred as the default reduction if enabled. The second reduction has one lookahead. */ b: %empty; c: %empty; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 'a', 'a', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/reduce.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/reduce.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/reduce.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $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:1694: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "reduce.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: sed -n '/^State 0\$/,\$p' input.output" at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1694" ( $at_check_trace; sed -n '/^State 0$/,$p' input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . a b 2 | . a b 'a' 3 | . a c 'b' 4 a: . 'a' 'a' shift, and go to state 1 start go to state 2 a go to state 3 State 1 4 a: 'a' . [\$end, 'a', 'b'] \$end reduce using rule 4 (a) 'a' reduce using rule 4 (a) 'b' reduce using rule 4 (a) State 2 0 \$accept: start . \$end \$end shift, and go to state 4 State 3 1 start: a . b 2 | a . b 'a' 3 | a . c 'b' 5 b: . %empty [\$end, 'a'] 6 c: . %empty ['b'] \$end reduce using rule 5 (b) 'a' reduce using rule 5 (b) 'b' reduce using rule 6 (c) b go to state 5 c go to state 6 State 4 0 \$accept: start \$end . \$default accept State 5 1 start: a b . [\$end] 2 | a b . 'a' 'a' shift, and go to state 7 \$end reduce using rule 1 (start) State 6 3 start: a c . 'b' 'b' shift, and go to state 8 State 7 2 start: a b 'a' . [\$end] \$end reduce using rule 2 (start) State 8 3 start: a c 'b' . [\$end] \$end reduce using rule 3 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1694" $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. $as_echo "reduce.at:1694" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/reduce.at:1694" { set +x $as_echo "$at_srcdir/reduce.at:1694: \$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:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/reduce.at:1694: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "reduce.at:1694" ( $at_check_trace; 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:1694" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'report.at:24' \ "Reports" " " 8 at_xfail=no ( $as_echo "185. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %token END 0 "end of file" ASSIGN ":=" INCR "incr" ; %token IDENTIFIER "identifier" %type id %token NUMBER "number" %type exp %% %start unit; unit: assignments exp { driver.result = $2; }; assignments: %empty {} | assignments assignment {}; assignment: id ":=" exp { driver.variables[$id] = $exp; }; id: "identifier"; exp: "incr" exp { $$ = 1; } { $$ = 10; } exp { $$ = $2 + $3 + $4 + $5; } | "(" exp ")" { std::swap ($$, $2); } | "identifier" { $$ = driver.variables[$1]; } | "number" { std::swap ($$, $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/report.at:62: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc -v --xml input.yy" at_fn_check_prepare_notrace 'an embedded newline' "report.at:62" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.cc -v --xml input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/report.at:62" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/report.at:62: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -v --xml input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -v --xml input.yy" "report.at:62" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -v --xml input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/report.at:62" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/report.at:62: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "report.at:62" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/report.at:62" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/report.at:62: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "report.at:62" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/report.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/report.at:62: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc -v --graph=input.gv --xml input.yy" at_fn_check_prepare_trace "report.at:62" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc -v --graph=input.gv --xml 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/report.at:62" $at_failed && at_fn_log_failure $at_traceon; } # Check the contents of the report. { set +x $as_echo "$at_srcdir/report.at:303: cat input.output" at_fn_check_prepare_trace "report.at:303" ( $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: unit \"end of file\" 1 unit: assignments exp 2 assignments: %empty 3 | assignments assignment 4 assignment: id \":=\" exp 5 id: \"identifier\" 6 @1: %empty 7 @2: %empty 8 exp: \"incr\" exp @1 @2 exp 9 | \"(\" exp \")\" 10 | \"identifier\" 11 | \"number\" Terminals, with rules where they appear \"end of file\" (0) 0 error (256) \":=\" (258) 4 \"incr\" (259) 8 \"identifier\" (260) 5 10 \"number\" (261) 11 \"(\" (262) 9 \")\" (263) 9 Nonterminals, with rules where they appear \$accept (9) on left: 0 unit (10) on left: 1 on right: 0 assignments (11) on left: 2 3 on right: 1 3 assignment (12) on left: 4 on right: 3 id (13) on left: 5 on right: 4 exp (14) on left: 8 9 10 11 on right: 1 4 8 9 @1 (15) on left: 6 on right: 8 @2 (16) on left: 7 on right: 8 State 0 0 \$accept: . unit \"end of file\" \$default reduce using rule 2 (assignments) unit go to state 1 assignments go to state 2 State 1 0 \$accept: unit . \"end of file\" \"end of file\" shift, and go to state 3 State 2 1 unit: assignments . exp 3 assignments: assignments . assignment \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 5 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 assignment go to state 8 id go to state 9 exp go to state 10 State 3 0 \$accept: unit \"end of file\" . \$default accept State 4 8 exp: \"incr\" . exp @1 @2 exp \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 11 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 exp go to state 12 State 5 5 id: \"identifier\" . 10 exp: \"identifier\" . \"end of file\" reduce using rule 10 (exp) \$default reduce using rule 5 (id) State 6 11 exp: \"number\" . \$default reduce using rule 11 (exp) State 7 9 exp: \"(\" . exp \")\" \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 11 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 exp go to state 13 State 8 3 assignments: assignments assignment . \$default reduce using rule 3 (assignments) State 9 4 assignment: id . \":=\" exp \":=\" shift, and go to state 14 State 10 1 unit: assignments exp . \$default reduce using rule 1 (unit) State 11 10 exp: \"identifier\" . \$default reduce using rule 10 (exp) State 12 8 exp: \"incr\" exp . @1 @2 exp \$default reduce using rule 6 (@1) @1 go to state 15 State 13 9 exp: \"(\" exp . \")\" \")\" shift, and go to state 16 State 14 4 assignment: id \":=\" . exp \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 11 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 exp go to state 17 State 15 8 exp: \"incr\" exp @1 . @2 exp \$default reduce using rule 7 (@2) @2 go to state 18 State 16 9 exp: \"(\" exp \")\" . \$default reduce using rule 9 (exp) State 17 4 assignment: id \":=\" exp . \$default reduce using rule 4 (assignment) State 18 8 exp: \"incr\" exp @1 @2 . exp \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 11 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 exp go to state 19 State 19 8 exp: \"incr\" exp @1 @2 exp . \$default reduce using rule 8 (exp) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/report.at:303" $at_failed && at_fn_log_failure $at_traceon; } # Now generate verbose reports. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/report.at:307: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc -rall --xml input.yy" at_fn_check_prepare_notrace 'an embedded newline' "report.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.cc -rall --xml input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/report.at:307" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/report.at:307: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -rall --xml input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -rall --xml input.yy" "report.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -rall --xml input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/report.at:307" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/report.at:307: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "report.at:307" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/report.at:307" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/report.at:307: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "report.at:307" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/report.at:307" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/report.at:307: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc -rall --graph=input.gv --xml input.yy" at_fn_check_prepare_trace "report.at:307" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc -rall --graph=input.gv --xml 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/report.at:307" $at_failed && at_fn_log_failure $at_traceon; } # Check the contents of the report. { set +x $as_echo "$at_srcdir/report.at:575: cat input.output" at_fn_check_prepare_trace "report.at:575" ( $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: unit \"end of file\" 1 unit: assignments exp 2 assignments: %empty 3 | assignments assignment 4 assignment: id \":=\" exp 5 id: \"identifier\" 6 @1: %empty 7 @2: %empty 8 exp: \"incr\" exp @1 @2 exp 9 | \"(\" exp \")\" 10 | \"identifier\" 11 | \"number\" Terminals, with rules where they appear \"end of file\" (0) 0 error (256) \":=\" (258) 4 \"incr\" (259) 8 \"identifier\" (260) 5 10 \"number\" (261) 11 \"(\" (262) 9 \")\" (263) 9 Nonterminals, with rules where they appear \$accept (9) on left: 0 unit (10) on left: 1 on right: 0 assignments (11) on left: 2 3 on right: 1 3 assignment (12) on left: 4 on right: 3 id (13) on left: 5 on right: 4 exp (14) on left: 8 9 10 11 on right: 1 4 8 9 @1 (15) on left: 6 on right: 8 @2 (16) on left: 7 on right: 8 State 0 0 \$accept: . unit \"end of file\" 1 unit: . assignments exp 2 assignments: . %empty 3 | . assignments assignment \$default reduce using rule 2 (assignments) unit go to state 1 assignments go to state 2 State 1 0 \$accept: unit . \"end of file\" \"end of file\" shift, and go to state 3 State 2 1 unit: assignments . exp 3 assignments: assignments . assignment 4 assignment: . id \":=\" exp 5 id: . \"identifier\" 8 exp: . \"incr\" exp @1 @2 exp 9 | . \"(\" exp \")\" 10 | . \"identifier\" 11 | . \"number\" \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 5 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 assignment go to state 8 id go to state 9 exp go to state 10 State 3 0 \$accept: unit \"end of file\" . \$default accept State 4 8 exp: . \"incr\" exp @1 @2 exp 8 | \"incr\" . exp @1 @2 exp 9 | . \"(\" exp \")\" 10 | . \"identifier\" 11 | . \"number\" \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 11 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 exp go to state 12 State 5 5 id: \"identifier\" . [\":=\"] 10 exp: \"identifier\" . [\"end of file\"] \"end of file\" reduce using rule 10 (exp) \$default reduce using rule 5 (id) State 6 11 exp: \"number\" . \$default reduce using rule 11 (exp) State 7 8 exp: . \"incr\" exp @1 @2 exp 9 | . \"(\" exp \")\" 9 | \"(\" . exp \")\" 10 | . \"identifier\" 11 | . \"number\" \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 11 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 exp go to state 13 State 8 3 assignments: assignments assignment . \$default reduce using rule 3 (assignments) State 9 4 assignment: id . \":=\" exp \":=\" shift, and go to state 14 State 10 1 unit: assignments exp . \$default reduce using rule 1 (unit) State 11 10 exp: \"identifier\" . \$default reduce using rule 10 (exp) State 12 6 @1: . %empty 8 exp: \"incr\" exp . @1 @2 exp \$default reduce using rule 6 (@1) @1 go to state 15 State 13 9 exp: \"(\" exp . \")\" \")\" shift, and go to state 16 State 14 4 assignment: id \":=\" . exp 8 exp: . \"incr\" exp @1 @2 exp 9 | . \"(\" exp \")\" 10 | . \"identifier\" 11 | . \"number\" \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 11 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 exp go to state 17 State 15 7 @2: . %empty 8 exp: \"incr\" exp @1 . @2 exp \$default reduce using rule 7 (@2) @2 go to state 18 State 16 9 exp: \"(\" exp \")\" . \$default reduce using rule 9 (exp) State 17 4 assignment: id \":=\" exp . \$default reduce using rule 4 (assignment) State 18 8 exp: . \"incr\" exp @1 @2 exp 8 | \"incr\" exp @1 @2 . exp 9 | . \"(\" exp \")\" 10 | . \"identifier\" 11 | . \"number\" \"incr\" shift, and go to state 4 \"identifier\" shift, and go to state 11 \"number\" shift, and go to state 6 \"(\" shift, and go to state 7 exp go to state 19 State 19 8 exp: \"incr\" exp @1 @2 exp . \$default reduce using rule 8 (exp) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/report.at:575" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/report.at:670: sed -e '1s/GNU Bison .*\\.\$/GNU Bison VERSION./' input.gv" at_fn_check_prepare_dynamic "sed -e '1s/GNU Bison .*\\.$/GNU Bison VERSION./' input.gv" "report.at:670" ( $at_check_trace; sed -e '1s/GNU Bison .*\.$/GNU Bison VERSION./' input.gv ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "// Generated by GNU Bison VERSION. // Report bugs to . // Home page: . digraph \"input.yy\" { node [fontname = courier, shape = box, colorscheme = paired6] edge [fontname = courier] 0 [label=\"State 0\\n\\l 0 \$accept: . unit \\\"end of file\\\"\\l 1 unit: . assignments exp\\l 2 assignments: . %empty\\l 3 | . assignments assignment\\l\"] 0 -> 1 [style=dashed label=\"unit\"] 0 -> 2 [style=dashed label=\"assignments\"] 0 -> \"0R2\" [style=solid] \"0R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled] 1 [label=\"State 1\\n\\l 0 \$accept: unit . \\\"end of file\\\"\\l\"] 1 -> 3 [style=solid label=\"\\\"end of file\\\"\"] 2 [label=\"State 2\\n\\l 1 unit: assignments . exp\\l 3 assignments: assignments . assignment\\l 4 assignment: . id \\\":=\\\" exp\\l 5 id: . \\\"identifier\\\"\\l 8 exp: . \\\"incr\\\" exp @1 @2 exp\\l 9 | . \\\"(\\\" exp \\\")\\\"\\l 10 | . \\\"identifier\\\"\\l 11 | . \\\"number\\\"\\l\"] 2 -> 4 [style=solid label=\"\\\"incr\\\"\"] 2 -> 5 [style=solid label=\"\\\"identifier\\\"\"] 2 -> 6 [style=solid label=\"\\\"number\\\"\"] 2 -> 7 [style=solid label=\"\\\"(\\\"\"] 2 -> 8 [style=dashed label=\"assignment\"] 2 -> 9 [style=dashed label=\"id\"] 2 -> 10 [style=dashed label=\"exp\"] 3 [label=\"State 3\\n\\l 0 \$accept: unit \\\"end of file\\\" .\\l\"] 3 -> \"3R0\" [style=solid] \"3R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled] 4 [label=\"State 4\\n\\l 8 exp: . \\\"incr\\\" exp @1 @2 exp\\l 8 | \\\"incr\\\" . exp @1 @2 exp\\l 9 | . \\\"(\\\" exp \\\")\\\"\\l 10 | . \\\"identifier\\\"\\l 11 | . \\\"number\\\"\\l\"] 4 -> 4 [style=solid label=\"\\\"incr\\\"\"] 4 -> 11 [style=solid label=\"\\\"identifier\\\"\"] 4 -> 6 [style=solid label=\"\\\"number\\\"\"] 4 -> 7 [style=solid label=\"\\\"(\\\"\"] 4 -> 12 [style=dashed label=\"exp\"] 5 [label=\"State 5\\n\\l 5 id: \\\"identifier\\\" . [\\\":=\\\"]\\l 10 exp: \\\"identifier\\\" . [\\\"end of file\\\"]\\l\"] 5 -> \"5R5\" [style=solid] \"5R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled] 5 -> \"5R10\" [label=\"[\\\"end of file\\\"]\", style=solid] \"5R10\" [label=\"R10\", fillcolor=3, shape=diamond, style=filled] 6 [label=\"State 6\\n\\l 11 exp: \\\"number\\\" .\\l\"] 6 -> \"6R11\" [style=solid] \"6R11\" [label=\"R11\", fillcolor=3, shape=diamond, style=filled] 7 [label=\"State 7\\n\\l 8 exp: . \\\"incr\\\" exp @1 @2 exp\\l 9 | . \\\"(\\\" exp \\\")\\\"\\l 9 | \\\"(\\\" . exp \\\")\\\"\\l 10 | . \\\"identifier\\\"\\l 11 | . \\\"number\\\"\\l\"] 7 -> 4 [style=solid label=\"\\\"incr\\\"\"] 7 -> 11 [style=solid label=\"\\\"identifier\\\"\"] 7 -> 6 [style=solid label=\"\\\"number\\\"\"] 7 -> 7 [style=solid label=\"\\\"(\\\"\"] 7 -> 13 [style=dashed label=\"exp\"] 8 [label=\"State 8\\n\\l 3 assignments: assignments assignment .\\l\"] 8 -> \"8R3\" [style=solid] \"8R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled] 9 [label=\"State 9\\n\\l 4 assignment: id . \\\":=\\\" exp\\l\"] 9 -> 14 [style=solid label=\"\\\":=\\\"\"] 10 [label=\"State 10\\n\\l 1 unit: assignments exp .\\l\"] 10 -> \"10R1\" [style=solid] \"10R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled] 11 [label=\"State 11\\n\\l 10 exp: \\\"identifier\\\" .\\l\"] 11 -> \"11R10\" [style=solid] \"11R10\" [label=\"R10\", fillcolor=3, shape=diamond, style=filled] 12 [label=\"State 12\\n\\l 6 @1: . %empty\\l 8 exp: \\\"incr\\\" exp . @1 @2 exp\\l\"] 12 -> 15 [style=dashed label=\"@1\"] 12 -> \"12R6\" [style=solid] \"12R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled] 13 [label=\"State 13\\n\\l 9 exp: \\\"(\\\" exp . \\\")\\\"\\l\"] 13 -> 16 [style=solid label=\"\\\")\\\"\"] 14 [label=\"State 14\\n\\l 4 assignment: id \\\":=\\\" . exp\\l 8 exp: . \\\"incr\\\" exp @1 @2 exp\\l 9 | . \\\"(\\\" exp \\\")\\\"\\l 10 | . \\\"identifier\\\"\\l 11 | . \\\"number\\\"\\l\"] 14 -> 4 [style=solid label=\"\\\"incr\\\"\"] 14 -> 11 [style=solid label=\"\\\"identifier\\\"\"] 14 -> 6 [style=solid label=\"\\\"number\\\"\"] 14 -> 7 [style=solid label=\"\\\"(\\\"\"] 14 -> 17 [style=dashed label=\"exp\"] 15 [label=\"State 15\\n\\l 7 @2: . %empty\\l 8 exp: \\\"incr\\\" exp @1 . @2 exp\\l\"] 15 -> 18 [style=dashed label=\"@2\"] 15 -> \"15R7\" [style=solid] \"15R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled] 16 [label=\"State 16\\n\\l 9 exp: \\\"(\\\" exp \\\")\\\" .\\l\"] 16 -> \"16R9\" [style=solid] \"16R9\" [label=\"R9\", fillcolor=3, shape=diamond, style=filled] 17 [label=\"State 17\\n\\l 4 assignment: id \\\":=\\\" exp .\\l\"] 17 -> \"17R4\" [style=solid] \"17R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled] 18 [label=\"State 18\\n\\l 8 exp: . \\\"incr\\\" exp @1 @2 exp\\l 8 | \\\"incr\\\" exp @1 @2 . exp\\l 9 | . \\\"(\\\" exp \\\")\\\"\\l 10 | . \\\"identifier\\\"\\l 11 | . \\\"number\\\"\\l\"] 18 -> 4 [style=solid label=\"\\\"incr\\\"\"] 18 -> 11 [style=solid label=\"\\\"identifier\\\"\"] 18 -> 6 [style=solid label=\"\\\"number\\\"\"] 18 -> 7 [style=solid label=\"\\\"(\\\"\"] 18 -> 19 [style=dashed label=\"exp\"] 19 [label=\"State 19\\n\\l 8 exp: \\\"incr\\\" exp @1 @2 exp .\\l\"] 19 -> \"19R8\" [style=solid] \"19R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled] } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/report.at:670" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/report.at:1138: sed -e 's/bison-xml-report version=\"[^\"]*\"/bison-xml-report version=\"VERSION\"/g' input.xml" at_fn_check_prepare_trace "report.at:1138" ( $at_check_trace; sed -e 's/bison-xml-report version="[^"]*"/bison-xml-report version="VERSION"/g' input.xml ) >>"$at_stdout" 2>>"$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.yy \$accept unit "end of file" unit assignments exp assignments assignments assignments assignment assignment id ":=" exp id "identifier" @1 @2 exp "incr" exp @1 @2 exp exp "(" exp ")" exp "identifier" exp "number" ":=" "end of file" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/report.at:1138" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:28' \ "Token declaration order" " " 9 at_xfail=no ( $as_echo "186. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (void); } %token A B C %token D %right E F G %right H I %right J %left K %left L M N %nonassoc O P Q %precedence R S T U %precedence V W %% exp: A %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } int main (void) { assert (A < B); assert (B < C); assert (C < D); assert (D < E); assert (E < F); assert (F < G); assert (G < H); assert (H < I); assert (I < J); assert (J < K); assert (K < L); assert (L < M); assert (M < N); assert (N < O); assert (O < P); assert (P < Q); assert (Q < R); assert (R < S); assert (S < T); assert (T < U); assert (U < V); assert (V < W); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:81: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:81" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:81: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:81" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:81: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:81" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:81" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:81: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:81" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:81: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:81" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:82" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:82" { set +x $as_echo "$at_srcdir/conflicts.at:82: \$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:82" ( $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:82" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:84: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:84" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:84" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:84: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:84" ( $at_check_trace; 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:84" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_186 #AT_START_187 at_fn_group_banner 187 'conflicts.at:101' \ "Token declaration order: literals vs. identifiers" "" 9 at_xfail=no ( $as_echo "187. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %token 'a' 'b' C D %token E F 'g' 'h' %right 'i' 'j' K L %right M N 'o' 'p' %% exp: 'a' | 'b' | C | D | E | F | 'g' | 'h' | 'i' | 'j' | K | L | M | N | 'o' | 'p' ; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:130: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:130" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:130: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:130" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:130: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:130" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:130" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:130: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:130" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:130: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:130" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:130" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:173: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'" at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:173" ( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . exp \$end 1 exp: . 'a' 2 | . 'b' 3 | . C 4 | . D 5 | . E 6 | . F 7 | . 'g' 8 | . 'h' 9 | . 'i' 10 | . 'j' 11 | . K 12 | . L 13 | . M 14 | . N 15 | . 'o' 16 | . 'p' 'a' shift, and go to state 1 'b' shift, and go to state 2 C shift, and go to state 3 D shift, and go to state 4 E shift, and go to state 5 F shift, and go to state 6 'g' shift, and go to state 7 'h' shift, and go to state 8 'i' shift, and go to state 9 'j' shift, and go to state 10 K shift, and go to state 11 L shift, and go to state 12 M shift, and go to state 13 N shift, and go to state 14 'o' shift, and go to state 15 'p' shift, and go to state 16 exp go to state 17 State 1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:173" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_187 #AT_START_188 at_fn_group_banner 188 'conflicts.at:183' \ "Useless associativity warning" " " 9 at_xfail=no ( $as_echo "188. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token EQ "=" PL "+" ST "*" LP "(" %nonassoc "=" %left "+" %left "*" %precedence "(" %% stmt: exp | "var" "=" exp ; exp: exp "+" exp | exp "*" "num" | "(" exp ")" | "num" ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:209: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wprecedence input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wprecedence input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:209" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:209: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence input.y" "conflicts.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:209" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:209: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:209" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:209" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:209: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:209" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:209" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:209: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wprecedence input.y" at_fn_check_prepare_trace "conflicts.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wprecedence input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-9: warning: useless precedence and associativity for \"=\" [-Wprecedence] input.y:4.1-5: warning: useless associativity for \"*\", use %precedence [-Wprecedence] input.y:5.1-11: warning: useless precedence for \"(\" [-Wprecedence] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:209" $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:209: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Werror" "conflicts.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:209" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:2.1-9: warning: useless precedence and associativity for "=" [-Wprecedence] input.y:4.1-5: warning: useless associativity for "*", use %precedence [-Wprecedence] input.y:5.1-11: warning: useless precedence for "(" [-Wprecedence] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:209: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:209" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:209" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:209: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=error" "conflicts.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:209" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:209: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Wnone,none -Werror --trace=none" "conflicts.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:209" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:209: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=none -Werror --trace=none" "conflicts.at:209" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:209" $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_188 #AT_START_189 at_fn_group_banner 189 'conflicts.at:218' \ "Useless precedence warning" " " 9 at_xfail=no ( $as_echo "189. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token A B U V W X Y Z %precedence Z %left X %precedence Y %left W %right V %nonassoc U %% a: b | a U b | f ; b: c | b V c ; c: d | c W d ; d: A | d X d | d Y A ; f: B | f Z B ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:261: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wprecedence -fcaret -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:261" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wprecedence -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:261" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:261: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence -fcaret -o input.c input.y" "conflicts.at:261" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:261" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:261: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:261" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:261" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:261: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:261" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:261" $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:261: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:261" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:7.1-9: warning: useless precedence and associativity for U [-Wprecedence] 7 | %nonassoc U | ^~~~~~~~~ input.y:6.1-6: warning: useless precedence and associativity for V [-Wprecedence] 6 | %right V | ^~~~~~ input.y:5.1-5: warning: useless precedence and associativity for W [-Wprecedence] 5 | %left W | ^~~~~ input.y:2.1-11: warning: useless precedence for Z [-Wprecedence] 2 | %precedence Z | ^~~~~~~~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:261" $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:261: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Werror" "conflicts.at:261" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:261" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:7.1-9: warning: useless precedence and associativity for U [-Wprecedence] 7 | %nonassoc U | ^~~~~~~~~ input.y:6.1-6: warning: useless precedence and associativity for V [-Wprecedence] 6 | %right V | ^~~~~~ input.y:5.1-5: warning: useless precedence and associativity for W [-Wprecedence] 5 | %left W | ^~~~~ input.y:2.1-11: warning: useless precedence for Z [-Wprecedence] 2 | %precedence Z | ^~~~~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:261: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:261" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:261" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:261: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=error" "conflicts.at:261" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:261" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:261: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:261" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:261" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:261: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:261" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:261" $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_189 #AT_START_190 at_fn_group_banner 190 'conflicts.at:275' \ "S/R in initial" " " 9 at_xfail=no ( $as_echo "190. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %expect 1 %% exp: e 'e'; e: 'e' | %empty; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:286: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:286" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:286" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:286: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:286" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:286" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:286: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:286" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:286" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:286: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:286" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:286: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:286" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.10-15: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at: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/conflicts.at:286: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "conflicts.at:286" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:286" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:4.10-15: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:286: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:286" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:286" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:286: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "conflicts.at:286" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:286" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:286: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:286" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:286" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:286: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:286" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:286" $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:292: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:292" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:292: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "conflicts.at:292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:292" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:292: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:292" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:292" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:292: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:292" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:292: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.10-15: warning: rule useless in parser due to conflicts [-Wother] 4 | e: '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:292" $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:292: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror" "conflicts.at:292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:292" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:4.10-15: warning: rule useless in parser due to conflicts [-Wother] 4 | e: 'e' | %empty; | ^~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:292: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:292" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:292" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:292: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error" "conflicts.at:292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:292" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:292: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:292" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:292: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:292" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:292" $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_190 #AT_START_191 at_fn_group_banner 191 'conflicts.at:301' \ "%nonassoc and eof" " " 9 at_xfail=no ( $as_echo "191. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include #include #define YYERROR_VERBOSE 1 /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /* The current argument. */ static const char *input; static int yylex (void) { static size_t toknum; assert (toknum <= strlen (input)); return input[toknum++]; } %} %nonassoc '<' '>' %% expr: expr '<' expr | expr '>' expr | '0' ; %% int main (int argc, const char *argv[]) { input = argc <= 1 ? "" : argv[1]; return yyparse (); } _ATEOF # Expected token list is missing. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:367" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:367: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:367" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:367" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:367: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:367" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:367: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:367" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:367" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:367" { set +x $as_echo "$at_srcdir/conflicts.at:367: \$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:367" ( $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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: \$PREPARSER ./input '0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:367" ( $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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:367" ( $at_check_trace; 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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: \$PREPARSER ./input '0<0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:367" ( $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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:367" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: \$PREPARSER ./input '0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:367" ( $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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:367" ( $at_check_trace; 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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: \$PREPARSER ./input '0>0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:367" ( $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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:367" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: \$PREPARSER ./input '0<0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:367" ( $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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:367" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:367" $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:372: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dlr.default-reduction=consistent -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dlr.default-reduction=consistent -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.default-reduction=consistent -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.default-reduction=consistent -o input.c input.y" "conflicts.at:372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.default-reduction=consistent -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:372: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:372" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:372" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:372: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:372" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:372: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.default-reduction=consistent -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.default-reduction=consistent -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:372" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:372" { set +x $as_echo "$at_srcdir/conflicts.at:372: \$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:372" ( $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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:372" ( $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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:372" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0<0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:372" ( $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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:372" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:372" ( $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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:372" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0>0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:372" ( $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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:372" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0<0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:372" ( $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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:372" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "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:372" $at_failed && at_fn_log_failure $at_traceon; } # lr.default-reduction=consistent happens to work for this test case. # However, for other grammars, lookahead sets can be merged for # different left contexts, so it is still possible to have an incorrect # expected list. Canonical LR is almost a general solution (that is, it # can fail only when %nonassoc is used), so make sure it gives the same # result as above. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:380: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:380" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:380" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:380" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:380: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:380" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:380" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:380: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:380" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:380: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:380" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:380" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:380" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:380" { set +x $as_echo "$at_srcdir/conflicts.at:380: \$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:380" ( $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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: \$PREPARSER ./input '0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:380" ( $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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:380" ( $at_check_trace; 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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: \$PREPARSER ./input '0<0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:380" ( $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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:380" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: \$PREPARSER ./input '0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:380" ( $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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:380" ( $at_check_trace; 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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: \$PREPARSER ./input '0>0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:380" ( $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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:380" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: \$PREPARSER ./input '0<0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:380" ( $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:380" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:380: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:380" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:380" $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:387: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:387" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" "conflicts.at:387" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:387" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:387: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:387" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:387" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:387: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:387" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:387" $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:387: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:387" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:387" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:387" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:387" { set +x $as_echo "$at_srcdir/conflicts.at:387: \$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:387" ( $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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: \$PREPARSER ./input '0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:387" ( $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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:387" ( $at_check_trace; 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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: \$PREPARSER ./input '0<0<0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:387" ( $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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:387" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: \$PREPARSER ./input '0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:387" ( $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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:387" ( $at_check_trace; 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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: \$PREPARSER ./input '0>0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:387" ( $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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:387" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: \$PREPARSER ./input '0<0>0'" at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:387" ( $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:387" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:387" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:387" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:511' \ "parse.error=verbose and consistent errors: lr.type=ielr" "" 9 at_xfail=no ( $as_echo "192. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.type ielr %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:511: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:511" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:511" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at: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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:511: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:511" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:511" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:511" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:511" { set +x $as_echo "$at_srcdir/conflicts.at:511: \$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:511" ( $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:511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:511: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:511" ( $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:511" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:511: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:511" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:511" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:516' \ "parse.error=verbose and consistent errors: lr.type=ielr %glr-parser" "" 9 at_xfail=no ( $as_echo "193. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %define lr.type ielr %glr-parser %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:516: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:516" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:516" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:516: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:516" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:516" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:516: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:516" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:516" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:516: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:516" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:516: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:516" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:516" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:516" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:516" { set +x $as_echo "$at_srcdir/conflicts.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" "conflicts.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/conflicts.at:516" $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 \$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:516" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:521' \ "parse.error=verbose and consistent errors: lr.type=ielr c++" "" 9 at_xfail=no ( $as_echo "194. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static int yylex (yy::parser::semantic_type *lvalp); #define USE(Var) } %defines %define lr.type ielr %language "c++" %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } /*-------. | main. | `-------*/ #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at: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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:521: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "conflicts.at:521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:521" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:521" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:521" { set +x $as_echo "$at_srcdir/conflicts.at:521: \$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:521" ( $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:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:521: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:521" ( $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:521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:521: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:521" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:521" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:526' \ "parse.error=verbose and consistent errors: lr.type=ielr java" "" 9 at_xfail=no ( $as_echo "195. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code imports { import java.io.IOException; } %define lr.type ielr %language "java" %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %code lexer { /*--------. | yylex. | `--------*/ public String input = "a"; public int index = 0; public int yylex () { if (index < input.length ()) return input.charAt (index++); else return 0; } public Object getLVal () { return new Integer(1); } public void yyerror (String m) { System.err.println (m); } }; %% /*-------. | main. | `-------*/ class input { public static void main (String[] args) throws IOException { YYParser p = new YYParser (); boolean success = p.parse (); if (!success) System.exit (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/conflicts.at:526: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:526" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:526" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:526: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" "conflicts.at:526" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:526" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:526: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:526" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:526" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:526: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:526" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:526" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:526: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.java input.y" at_fn_check_prepare_trace "conflicts.at:526" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:526" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:526" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:526" $as_echo "conflicts.at:526" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:526" { set +x $as_echo "$at_srcdir/conflicts.at:526: \$SHELL ../../../javacomp.sh input.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "conflicts.at:526" ( $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:526" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:526: \$SHELL ../../../javaexec.sh input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "conflicts.at:526" ( $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 1 $at_status "$at_srcdir/conflicts.at:526" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_195 #AT_START_196 at_fn_group_banner 196 'conflicts.at:533' \ "parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=consistent" "" 9 at_xfail=no ( $as_echo "196. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.type ielr %define lr.default-reduction consistent %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:533: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:533" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:533: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:533" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:533" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:533: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:533" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:533" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:533: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:533" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:533" $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:533: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:533" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:533" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:533" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:533" { set +x $as_echo "$at_srcdir/conflicts.at:533: \$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:533" ( $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:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:533: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:533" ( $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:533" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:533: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:533" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:533" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:538' \ "parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=accepting" "" 9 at_xfail=no ( $as_echo "197. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.type ielr %define lr.default-reduction accepting %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:538" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:538: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:538" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:538" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:538: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:538" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:538" $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:538: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:538" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:538" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:538" { set +x $as_echo "$at_srcdir/conflicts.at:538: \$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:538" ( $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:538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:538: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:538" ( $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:538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:538: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:538" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:538" $at_failed && at_fn_log_failure $at_traceon; } set +x $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:542' \ "parse.error=verbose and consistent errors: lr.type=canonical-lr" "" 9 at_xfail=no ( $as_echo "198. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.type canonical-lr %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:542: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:542" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:542" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:542: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:542" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:542" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:542: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:542" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:542" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:542: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:542" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:542: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:542" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:542" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:542" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:542" { set +x $as_echo "$at_srcdir/conflicts.at:542: \$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:542" ( $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:542" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:542: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:542" ( $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:542" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:542: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:542" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: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_198 #AT_START_199 at_fn_group_banner 199 'conflicts.at:549' \ "parse.error=verbose and consistent errors: lr.type=canonical-lr parse.lac=full" "" 9 at_xfail=no ( $as_echo "199. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.type canonical-lr %define parse.lac full %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:549: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:549" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:549" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:549: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:549" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:549" $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:549: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:549" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:549" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:549" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:549" { set +x $as_echo "$at_srcdir/conflicts.at:549: \$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:549" ( $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:549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:549: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:549" ( $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:549" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:549: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:549" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:549" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:554' \ "parse.error=verbose and consistent errors: lr.type=ielr parse.lac=full" "" 9 at_xfail=no ( $as_echo "200. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.type ielr %define parse.lac full %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:554: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:554" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:554: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:554" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:554" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:554: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:554" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:554" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:554: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:554" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:554" $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:554: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:554" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:554" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:554" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:554" { set +x $as_echo "$at_srcdir/conflicts.at:554: \$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:554" ( $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:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:554: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:554" ( $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:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:554: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:554" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:554" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_200 #AT_START_201 at_fn_group_banner 201 'conflicts.at:562' \ "parse.error=verbose and consistent errors: c++ lr.type=canonical-lr parse.lac=full" "" 9 at_xfail=no ( $as_echo "201. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static int yylex (yy::parser::semantic_type *lvalp); #define USE(Var) } %defines %language "c++" %define lr.type canonical-lr %define parse.lac full %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } /*-------. | main. | `-------*/ #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:562: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:562" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:562: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:562" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:562" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:562: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:562" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:562" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:562: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:562" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:562" $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:562: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "conflicts.at:562" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:562" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:562" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:562" { set +x $as_echo "$at_srcdir/conflicts.at:562: \$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:562" ( $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:562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:562: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:562" ( $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:562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:562: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:562" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:562" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:568' \ "parse.error=verbose and consistent errors: c++ lr.type=ielr parse.lac=full" "" 9 at_xfail=no ( $as_echo "202. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static int yylex (yy::parser::semantic_type *lvalp); #define USE(Var) } %defines %language "c++" %define lr.type ielr %define parse.lac full %define parse.error verbose %% %nonassoc 'a'; start: consistent-error-on-a-a 'a' ; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' | 'a' shift ; default-reduction: %empty ; shift: 'b' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error-on-a-a 'c' ; %% #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } /*-------. | main. | `-------*/ #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:568: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:568" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:568" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:568: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:568" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:568" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:568: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:568" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:568" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:568: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:568" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:568" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:568: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "conflicts.at:568" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:568" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:568" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:568" { set +x $as_echo "$at_srcdir/conflicts.at:568: \$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:568" ( $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:568" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:568: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:568" ( $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:568" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:568: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:568" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:568" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_202 #AT_START_203 at_fn_group_banner 203 'conflicts.at:624' \ "parse.error=verbose and consistent errors: " " " 9 at_xfail=no ( $as_echo "203. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define parse.error verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: %empty { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | %empty %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:624: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:624" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:624" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:624: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:624" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:624" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:624: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:624" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:624" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:624: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:624" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:624" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:624: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:624" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:624" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:624" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:624" { set +x $as_echo "$at_srcdir/conflicts.at:624: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:624" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:624" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:624: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:624" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:624" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:624: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:624" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected 'b' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:624" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_203 #AT_START_204 at_fn_group_banner 204 'conflicts.at:628' \ "parse.error=verbose and consistent errors: %glr-parser" "" 9 at_xfail=no ( $as_echo "204. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %glr-parser %define parse.error verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: %empty { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | %empty %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:628: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:628" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:628" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:628: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:628" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:628" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:628: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:628" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:628" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:628: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:628" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:628" $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:628: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:628" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:628" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:628" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:628" { set +x $as_echo "$at_srcdir/conflicts.at:628: \$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:628" ( $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:628" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:628: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:628" ( $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:628" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:628: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:628" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:628" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_204 #AT_START_205 at_fn_group_banner 205 'conflicts.at:634' \ "parse.error=verbose and consistent errors: lr.default-reduction=consistent" "" 9 at_xfail=no ( $as_echo "205. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.default-reduction consistent %define parse.error verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: %empty { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | %empty %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:634: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:634" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:634" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:634: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:634" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:634" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:634: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:634" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:634" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:634: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:634" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:634" $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:634: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:634" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:634" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:634" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:634" { set +x $as_echo "$at_srcdir/conflicts.at:634: \$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:634" ( $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:634" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:634: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:634" ( $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:634" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:634: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:634" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:634" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:640' \ "parse.error=verbose and consistent errors: lr.default-reduction=accepting" "" 9 at_xfail=no ( $as_echo "206. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.default-reduction accepting %define parse.error verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: %empty { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | %empty %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:640: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:640" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:640: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:640" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:640" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:640: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:640" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:640" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:640: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:640" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:640" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:640: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:640" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:640" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:640" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:640" { set +x $as_echo "$at_srcdir/conflicts.at:640: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:640" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:640: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:640" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:640" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:640: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:640" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected \$end, expecting 'a' " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:640" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_206 #AT_START_207 at_fn_group_banner 207 'conflicts.at:644' \ "parse.error=verbose and consistent errors: lr.type=canonical-lr" "" 9 at_xfail=no ( $as_echo "207. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define lr.type canonical-lr %define parse.error verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: %empty { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | %empty %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:644: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:644" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:644: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:644" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:644" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:644: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:644" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:644" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:644: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:644" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:644: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:644" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:644" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:644" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:644" { set +x $as_echo "$at_srcdir/conflicts.at:644: \$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:644" ( $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:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:644: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:644" ( $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:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:644: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.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 "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: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_207 #AT_START_208 at_fn_group_banner 208 'conflicts.at:649' \ "parse.error=verbose and consistent errors: parse.lac=full" "" 9 at_xfail=no ( $as_echo "208. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define parse.lac full %define parse.error verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: %empty { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | %empty %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:649: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:649" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:649: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:649" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:649" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:649: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:649" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:649" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:649: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:649" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:649" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:649: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:649" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:649" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:649" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:649" { set +x $as_echo "$at_srcdir/conflicts.at:649: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:649" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:649: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:649" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:649" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:649: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:649" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error, unexpected '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: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_208 #AT_START_209 at_fn_group_banner 209 'conflicts.at:654' \ "parse.error=verbose and consistent errors: parse.lac=full lr.default-reduction=accepting" "" 9 at_xfail=no ( $as_echo "209. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); #define USE(Var) } %define api.pure %code { #if defined __GNUC__ && 8 <= __GNUC__ # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif } %define parse.lac full %define lr.default-reduction accepting %define parse.error verbose %% %nonassoc 'a'; // If $$ = 0 here, then we know that the 'a' destructor is being invoked // incorrectly for the 'b' set in the semantic action below. All 'a' // tokens are returned by yylex, which sets $$ = 1. %destructor { if (!$$) fprintf (stderr, "Wrong destructor.\n"); } 'a'; // Rather than depend on an inconsistent state to induce reading a // lookahead as in the previous grammar, just assign the lookahead in a // semantic action. That lookahead isn't needed before either error // action is encountered. In a previous version of Bison, this was a // problem as it meant yychar was not translated into yytoken before // either error action. The second error action thus invoked a // destructor that it selected according to the incorrect yytoken. The // first error action would have reported an incorrect unexpected token // except that, due to the bug described in the previous grammar, the // unexpected token was not reported at all. start: error-reduce consistent-error 'a' { USE ($3); } ; error-reduce: 'a' 'a' consistent-reduction consistent-error 'a' { USE (($1, $2, $5)); } | 'a' error { USE ($1); } ; consistent-reduction: %empty { assert (yychar == YYEMPTY); yylval = 0; yychar = 'b'; } ; consistent-error: 'a' { USE ($1); } | %empty %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error 'b' ; %% #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = 1; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /*-------. | main. | `-------*/ #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:654: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:654" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:654: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:654" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:654" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:654: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:654" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:654" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:654: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:654" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:654: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:654" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:654" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "conflicts.at:654" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:654" { set +x $as_echo "$at_srcdir/conflicts.at:654: \$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:654" ( $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:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:654: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:654" ( $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:654" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:654: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.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 >>"$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: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_209 #AT_START_210 at_fn_group_banner 210 'conflicts.at:675' \ "LAC: %nonassoc requires splitting canonical LR states" "" 9 at_xfail=no ( $as_echo "210. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #include static void yyerror (const char *msg); static int yylex (void); } %define parse.error verbose %nonassoc 'a' %% start: 'a' problem 'a' // First context. | 'b' problem 'b' // Second context. | 'c' reduce-nonassoc // Just makes reduce-nonassoc useful. ; problem: look reduce-nonassoc | look 'a' | look 'b' ; // For the state reached after shifting the 'a' in these productions, // lookahead sets are the same in both the first and second contexts. // Thus, canonical LR reuses the same state for both contexts. However, // the lookahead 'a' for the reduction "look: 'a'" later becomes an // error action only in the first context. In order to immediately // detect the syntax error on 'a' here for only the first context, this // canonical LR state would have to be split into two states, and the // 'a' lookahead would have to be removed from only one of the states. look: 'a' // Reduction lookahead set is always ['a', 'b']. | 'a' 'b' | 'a' 'c' // 'c' is forgotten as an expected token. ; reduce-nonassoc: %prec 'a'; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "aaa"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # Show canonical LR's failure. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:728: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:728" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:728: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:728" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:728: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:728" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:728" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:728: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:728" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:728" $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:728: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:728" $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:728: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Werror" "conflicts.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:728" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:728: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:728" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:728" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:728: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=error" "conflicts.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:728" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:728: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:728" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:728: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:728" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "conflicts.at:729" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:729" { set +x $as_echo "$at_srcdir/conflicts.at:729: \$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:729" ( $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:729" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:732: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:732" ( $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:732" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:732: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:732" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:732" $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:738: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:738" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:738" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:738: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:738" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:738" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:738: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:738" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:738" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:738: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:738" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:738" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:738: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:738" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:738" $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:738: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y -Werror" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:738" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:738" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:738: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:738" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:738" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:738: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y --warnings=error" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:738" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:738" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:738: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:738" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:738" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:738: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\ -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:738" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \ -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:738" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "conflicts.at:739" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:739" { set +x $as_echo "$at_srcdir/conflicts.at:739: \$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:739" ( $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:739" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:742: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:742" ( $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:742" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:742: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:742" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:742" $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:748: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:748" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:748" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" "conflicts.at:748" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:748: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:748" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:748" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:748: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:748" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:748" $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:748: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:748" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748" $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:748: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Werror" "conflicts.at:748" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:748" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:748: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:748" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=error" "conflicts.at:748" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:748" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:748" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:748" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:748" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:748" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "conflicts.at:749" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:749" { set +x $as_echo "$at_srcdir/conflicts.at:749: \$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:749" ( $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:749" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:752: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:752" ( $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:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.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 "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: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_210 #AT_START_211 at_fn_group_banner 211 'conflicts.at:760' \ "Unresolved SR Conflicts" " " 9 at_xfail=no ( $as_echo "211. $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:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:772" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:772: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:772" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:772" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:772: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:772" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/conflicts.at:772: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c --report=all input.y" at_fn_check_prepare_trace "conflicts.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at: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/conflicts.at:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror" "conflicts.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:772" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:772: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:772" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error" "conflicts.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:772" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none" "conflicts.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none" "conflicts.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:772" $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:858: cat input.output" at_fn_check_prepare_trace "conflicts.at:858" ( $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:858" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:868' \ "Resolved SR Conflicts" " " 9 at_xfail=no ( $as_echo "212. $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:879: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:879" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:879: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:879" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:879" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:879: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:879" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:879" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:879: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:879" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:879" $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:879: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c --report=all input.y" at_fn_check_prepare_trace "conflicts.at:879" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Check the contents of the report. { set +x $as_echo "$at_srcdir/conflicts.at:961: cat input.output" at_fn_check_prepare_trace "conflicts.at:961" ( $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:961" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:970' \ "%precedence suffices" " " 9 at_xfail=no ( $as_echo "213. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %precedence "then" %precedence "else" %% stmt: "if" cond "then" stmt | "if" cond "then" stmt "else" stmt | "stmt" ; cond: "exp" ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:987: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:987" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:987" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:987: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:987" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:987" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:987: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:987" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:987" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:987: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:987" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:987" $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:987: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:987" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:987" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:996' \ "%precedence does not suffice" " " 9 at_xfail=no ( $as_echo "214. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %precedence "then" %precedence "else" %% stmt: "if" cond "then" stmt | "if" cond "then" stmt "else" stmt | "stmt" ; cond: "exp" | cond "then" cond ; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1017: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1017" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1017" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1017: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1017" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1017" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1017: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1017" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1017" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1017: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1017" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1017" $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:1017: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1017" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] input.y:12.3-18: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1017" $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:1017: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "conflicts.at:1017" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1017" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] input.y:12.3-18: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1017: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1017" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1017" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1017: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "conflicts.at:1017" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1017" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1017: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1017" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1017" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1017: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1017" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1017" $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_214 #AT_START_215 at_fn_group_banner 215 'conflicts.at:1076' \ "Syntax error in consistent error state: yacc.c" " " 9 at_xfail=no ( $as_echo "215. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %skeleton "yacc.c" %% %nonassoc 'a'; start: 'a' consistent-error-on-a-a 'a'; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' ; default-reduction: %empty; %code { #include #include static void yyerror (const char *msg); static int yylex (void); }; %% /* 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[] = "aa"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1076" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1076" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $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:1076: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother] input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $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:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother] input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1076: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1076" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "conflicts.at:1076" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:1076" { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$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:1076" ( $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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1076" ( $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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:1076" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1076' \ "Syntax error in consistent error state: glr.c" " " 9 at_xfail=no ( $as_echo "216. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %skeleton "glr.c" %% %nonassoc 'a'; start: 'a' consistent-error-on-a-a 'a'; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' ; default-reduction: %empty; %code { #include #include static void yyerror (const char *msg); static int yylex (void); }; %% /* 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[] = "aa"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1076" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1076" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $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:1076: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother] input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $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:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother] input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1076: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1076" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "conflicts.at:1076" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:1076" { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$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:1076" ( $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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1076" ( $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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:1076" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1076' \ "Syntax error in consistent error state: lalr1.cc" "" 9 at_xfail=no ( $as_echo "217. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %skeleton "lalr1.cc" %% %nonassoc 'a'; start: 'a' consistent-error-on-a-a 'a'; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' ; default-reduction: %empty; %code { #include static int yylex (yy::parser::semantic_type *lvalp); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1076" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1076" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $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:1076: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother] input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $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:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc 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:1076" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother] input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1076: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1076" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc 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:1076" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "conflicts.at:1076" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:1076" { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$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:1076" ( $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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1076" ( $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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:1076" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1076' \ "Syntax error in consistent error state: glr.cc" " " 9 at_xfail=no ( $as_echo "218. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %skeleton "glr.cc" %% %nonassoc 'a'; start: 'a' consistent-error-on-a-a 'a'; consistent-error-on-a-a: 'a' default-reduction | 'a' default-reduction 'a' ; default-reduction: %empty; %code { #include static int yylex (yy::parser::semantic_type *lvalp); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "aa"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1076" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1076" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $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:1076: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother] input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $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:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc 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:1076" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother] input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1076: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1076" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc 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:1076" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none" "conflicts.at:1076" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1076" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "conflicts.at:1076" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/conflicts.at:1076" { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$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:1076" ( $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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1076" ( $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:1076" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1076: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "conflicts.at:1076" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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/conflicts.at:1076" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1107' \ "Defaulted Conflicted Reduction" " " 9 at_xfail=no ( $as_echo "219. $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:1121: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1121" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1121: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:1121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1121" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1121: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1121" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1121" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1121: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1121" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1121" $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:1121: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c --report=all input.y" at_fn_check_prepare_trace "conflicts.at:1121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] input.y:4.6-8: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1121" $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:1121: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror" "conflicts.at:1121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1121" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] input.y:4.6-8: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1121: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1121" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1121" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1121: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error" "conflicts.at:1121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1121" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1121: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none" "conflicts.at:1121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1121" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1121: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none" "conflicts.at:1121" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1121" $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:1218: cat input.output" at_fn_check_prepare_trace "conflicts.at:1218" ( $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:1218" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1229' \ "%expect not enough" " " 9 at_xfail=no ( $as_echo "220. $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:1240: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1240" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: error: shift/reduce conflicts: 1 found, 0 expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1240" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_220 #AT_START_221 at_fn_group_banner 221 'conflicts.at:1248' \ "%expect right" " " 9 at_xfail=no ( $as_echo "221. $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:1257: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1257" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1257" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1257: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1257" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1257" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1257: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1257" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1257" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1257: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1257" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1257" $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:1257: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1257" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1257" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1265' \ "%expect too much" " " 9 at_xfail=no ( $as_echo "222. $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:1276: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1276" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: error: shift/reduce conflicts: 1 found, 2 expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1276" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1284' \ "%expect with reduce conflicts" " " 9 at_xfail=no ( $as_echo "223. $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:1295: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1295" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: error: reduce/reduce conflicts: 1 found, 0 expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1295" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1303' \ "%expect in grammar rule not enough" " " 9 at_xfail=no ( $as_echo "224. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token NUM OP %expect 1 %% exp: exp OP exp %expect 0 | NUM; _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:1314: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1314" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.6-25: error: shift/reduce conflicts for rule 1: 1 found, 0 expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1314" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1322' \ "%expect in grammar rule right" " " 9 at_xfail=no ( $as_echo "225. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token NUM OP %expect 1 %% exp: exp OP exp %expect 1 | 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:1331: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1331" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1331" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1331: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1331" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1331" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1331: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1331" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1331" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1331: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1331" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1331" $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:1331: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1331" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1331" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1339' \ "%expect in grammar rules" " " 9 at_xfail=no ( $as_echo "226. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %expect 4 %% exp: "number" | exp "+" exp %expect 2 | exp "*" exp %expect 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/conflicts.at:1350: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c -rall input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1350" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c -rall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1350" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1350: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -rall input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -rall input.y" "conflicts.at:1350" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -rall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1350" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1350: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1350" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1350" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1350: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1350" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1350" $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:1350: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -rall input.y" at_fn_check_prepare_trace "conflicts.at:1350" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -rall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1350" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1358' \ "%expect in grammar rule too much" " " 9 at_xfail=no ( $as_echo "227. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %token NUM OP %expect 1 %% exp: exp OP exp | NUM %expect 1; _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:1369: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1369" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:4.19-31: error: shift/reduce conflicts for rule 2: 0 found, 1 expected " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1369" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1377' \ "%expect-rr in grammar rule" " " 9 at_xfail=no ( $as_echo "228. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %glr-parser %expect-rr 3 %% exp : a '1' | a '2' | a '3' | b '1' | b '2' | b '3' a: b: %expect-rr 3 _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:1394: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1394" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1394" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1394: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1394" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1394" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1394: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1394" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1394" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1394: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1394" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1394" $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:1394: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1394" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1394" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1402' \ "%expect-rr too much in grammar rule" " " 9 at_xfail=no ( $as_echo "229. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %glr-parser %expect-rr 3 %% exp : a '1' | a '2' | a '3' | b '1' | b '2' | b '3' a: b: %expect-rr 4 _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:1423: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" "conflicts.at:1423" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:12.4-15: error: reduce/reduce conflicts for rule 8: 3 found, 4 expected 12 | b: %expect-rr 4 | ^~~~~~~~~~~~ " | \ $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:1423" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1431' \ "%expect-rr not enough in grammar rule" " " 9 at_xfail=no ( $as_echo "230. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %glr-parser %expect-rr 3 %% exp : a '1' | a '2' | a '3' | b '1' | b '2' | b '3' a: b: %expect-rr 2 _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:1452: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" "conflicts.at:1452" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:12.4-15: error: reduce/reduce conflicts for rule 8: 3 found, 2 expected 12 | b: %expect-rr 2 | ^~~~~~~~~~~~ " | \ $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:1452" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1460' \ "%prec with user string" " " 9 at_xfail=no ( $as_echo "231. $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:1469: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1469" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1469" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1469: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1469" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1469" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1469: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1469" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1469" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1469: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1469" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1469" $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:1469: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1469" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1469" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1477' \ "%no-default-prec without %prec" " " 9 at_xfail=no ( $as_echo "232. $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:1497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" "conflicts.at:1497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at: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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 4 shift/reduce conflicts [-Wconflicts-sr] input.y:1.1-5: warning: useless precedence and associativity for '+' [-Wprecedence] input.y:2.1-5: warning: useless precedence and associativity for '*' [-Wprecedence] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497" $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:1497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror" "conflicts.at:1497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 4 shift/reduce conflicts [-Wconflicts-sr] input.y:1.1-5: warning: useless precedence and associativity for '+' [-Wprecedence] input.y:2.1-5: warning: useless precedence and associativity for '*' [-Wprecedence] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1497: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1497" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error" "conflicts.at:1497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1497" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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; } { set +x $as_echo "$at_srcdir/conflicts.at:1497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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; } 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_232 #AT_START_233 at_fn_group_banner 233 'conflicts.at:1505' \ "%no-default-prec with %prec" " " 9 at_xfail=no ( $as_echo "233. $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:1521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1521" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1521: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1521" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1521" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1521: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1521" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1521" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1521: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1521" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1529' \ "%default-prec" " " 9 at_xfail=no ( $as_echo "234. $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:1545: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1545" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1545" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1545: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1545" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1545" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1545: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1545" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1545" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1545: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1545" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1545" $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:1545: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1545" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1545" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1553' \ "Unreachable States After Conflict Resolution" " " 9 at_xfail=no ( $as_echo "235. $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:1607: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1607" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:1607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1607: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y" "conflicts.at:1607" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1607" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1607: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1607" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1607" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1607: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1607" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1607" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1607: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input.y" at_fn_check_prepare_trace "conflicts.at:1607" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] input.y:12.5-20: warning: rule useless in parser due to conflicts [-Wother] input.y:20.5-20: warning: rule useless in parser due to conflicts [-Wother] input.y:21.4: warning: rule useless in parser due to conflicts [-Wother] input.y:25.14: warning: rule useless in parser due to conflicts [-Wother] input.y:25.16: warning: rule useless in parser due to conflicts [-Wother] input.y:31.5-7: warning: rule useless in parser due to conflicts [-Wother] input.y:32.4: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1607" $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:1607: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Werror" "conflicts.at:1607" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1607" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] input.y:12.5-20: warning: rule useless in parser due to conflicts [-Wother] input.y:20.5-20: warning: rule useless in parser due to conflicts [-Wother] input.y:21.4: warning: rule useless in parser due to conflicts [-Wother] input.y:25.14: warning: rule useless in parser due to conflicts [-Wother] input.y:25.16: warning: rule useless in parser due to conflicts [-Wother] input.y:31.5-7: warning: rule useless in parser due to conflicts [-Wother] input.y:32.4: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1607: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1607" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1607" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1607: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=error" "conflicts.at:1607" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1607" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1607: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Wnone,none -Werror --trace=none" "conflicts.at:1607" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1607: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=none -Werror --trace=none" "conflicts.at:1607" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1607" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/conflicts.at:1748: cat input.output" at_fn_check_prepare_trace "conflicts.at:1748" ( $at_check_trace; cat input.output ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Rules useless in parser due to conflicts 2 resolved_conflict: 'a' unreachable1 4 unreachable1: 'a' unreachable2 5 | %empty 6 unreachable2: %empty 7 | %empty 9 reported_conflicts: 'a' 10 | %empty State 4 conflicts: 1 shift/reduce State 5 conflicts: 1 reduce/reduce Grammar 0 \$accept: start \$end 1 start: resolved_conflict 'a' reported_conflicts 'a' 2 resolved_conflict: 'a' unreachable1 3 | %empty 4 unreachable1: 'a' unreachable2 5 | %empty 6 unreachable2: %empty 7 | %empty 8 reported_conflicts: 'a' 9 | 'a' 10 | %empty Terminals, with rules where they appear \$end (0) 0 'a' (97) 1 2 4 8 9 error (256) Nonterminals, with rules where they appear \$accept (4) on left: 0 start (5) on left: 1 on right: 0 resolved_conflict (6) on left: 2 3 on right: 1 unreachable1 (7) on left: 4 5 on right: 2 unreachable2 (8) on left: 6 7 on right: 4 reported_conflicts (9) on left: 8 9 10 on right: 1 State 0 0 \$accept: . start \$end 1 start: . resolved_conflict 'a' reported_conflicts 'a' 2 resolved_conflict: . 'a' unreachable1 3 | . %empty ['a'] \$default reduce using rule 3 (resolved_conflict) start go to state 1 resolved_conflict go to state 2 Conflict between rule 3 and token 'a' resolved as reduce (%left 'a'). State 1 0 \$accept: start . \$end \$end shift, and go to state 3 State 2 1 start: resolved_conflict . 'a' reported_conflicts 'a' 'a' shift, and go to state 4 State 3 0 \$accept: start \$end . \$default accept State 4 1 start: resolved_conflict 'a' . reported_conflicts 'a' 8 reported_conflicts: . 'a' 9 | . 'a' 10 | . %empty ['a'] 'a' shift, and go to state 5 'a' [reduce using rule 10 (reported_conflicts)] reported_conflicts go to state 6 State 5 8 reported_conflicts: 'a' . ['a'] 9 | 'a' . ['a'] 'a' reduce using rule 8 (reported_conflicts) 'a' [reduce using rule 9 (reported_conflicts)] \$default reduce using rule 8 (reported_conflicts) State 6 1 start: resolved_conflict 'a' reported_conflicts . 'a' 'a' shift, and go to state 7 State 7 1 start: resolved_conflict 'a' reported_conflicts 'a' . \$default reduce using rule 1 (start) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1748" $at_failed && at_fn_log_failure $at_traceon; } cat >input-keep.y <<'_ATEOF' %define lr.keep-unreachable-state _ATEOF { set +x $as_echo "$at_srcdir/conflicts.at:1753: cat input.y >> input-keep.y" at_fn_check_prepare_trace "conflicts.at:1753" ( $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:1753" $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:1762: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv input-keep.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:1762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1762: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-keep.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-keep.y" "conflicts.at:1762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-keep.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1762" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1762: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1762" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1762" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1762: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1762" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1762" $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:1762: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input-keep.y" at_fn_check_prepare_trace "conflicts.at:1762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret input-keep.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input-keep.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] input-keep.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] input-keep.y:22.4: warning: rule useless in parser due to conflicts [-Wother] input-keep.y:26.16: warning: rule useless in parser due to conflicts [-Wother] input-keep.y:32.5-7: warning: rule useless in parser due to conflicts [-Wother] input-keep.y:33.4: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1762" $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:1762: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Werror" "conflicts.at:1762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1762" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input-keep.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] input-keep.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] input-keep.y:22.4: warning: rule useless in parser due to conflicts [-Wother] input-keep.y:26.16: warning: rule useless in parser due to conflicts [-Wother] input-keep.y:32.5-7: warning: rule useless in parser due to conflicts [-Wother] input-keep.y:33.4: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1762: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1762" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1762" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1762: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=error" "conflicts.at:1762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1762" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1762: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Wnone,none -Werror --trace=none" "conflicts.at:1762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1762: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=none -Werror --trace=none" "conflicts.at:1762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1762" $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_235 #AT_START_236 at_fn_group_banner 236 'conflicts.at:1771' \ "Solved conflicts report for multiple reductions in a state" "" 9 at_xfail=no ( $as_echo "236. $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: %empty %prec 'a' ; empty_b: %empty %prec 'b' ; empty_c1: %empty %prec 'c' ; empty_c2: %empty %prec 'c' ; empty_c3: %empty %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:1797: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1797" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:1797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1797: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1797" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1797" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1797: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1797" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1797" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1797: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1797" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1797" $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:1797: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1797" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1836: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'" at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1836" ( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . 'a' 2 | . empty_a 'a' 3 | . 'b' 4 | . empty_b 'b' 5 | . 'c' 6 | . empty_c1 'c' 7 | . empty_c2 'c' 8 | . empty_c3 'c' 9 empty_a: . %empty ['a'] 10 empty_b: . %empty [] 11 empty_c1: . %empty [] 12 empty_c2: . %empty [] 13 empty_c3: . %empty ['c'] 'b' shift, and go to state 1 'c' reduce using rule 13 (empty_c3) \$default reduce using rule 9 (empty_a) start go to state 2 empty_a go to state 3 empty_b go to state 4 empty_c1 go to state 5 empty_c2 go to state 6 empty_c3 go to state 7 Conflict between rule 9 and token 'a' resolved as reduce (%left 'a'). Conflict between rule 10 and token 'b' resolved as shift (%right 'b'). Conflict between rule 11 and token 'c' resolved as shift (%right 'c'). Conflict between rule 12 and token 'c' resolved as shift (%right 'c'). Conflict between rule 13 and token 'c' resolved as reduce ('c' < 'd'). State 1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1836" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1851' \ "%nonassoc error actions for multiple reductions in a state" "" 9 at_xfail=no ( $as_echo "237. $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:1873: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1873" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:1873" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1873: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1873" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1873" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1873: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1873" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1873" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1873: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1873" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1873" $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:1873: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all -o input.c input.y" at_fn_check_prepare_trace "conflicts.at:1873" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1873" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1912: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'" at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1912" ( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p' ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "State 0 0 \$accept: . start \$end 1 start: . 'a' 2 | . empty_a 'a' 3 | . 'b' 4 | . empty_b 'b' 5 | . 'c' 6 | . empty_c1 'c' 7 | . empty_c2 'c' 8 | . empty_c3 'c' 9 empty_a: . %empty [] 10 empty_b: . %empty [] 11 empty_c1: . %empty [] 12 empty_c2: . %empty ['c'] 13 empty_c3: . %empty ['c'] 'a' error (nonassociative) 'b' error (nonassociative) 'c' error (nonassociative) 'c' [reduce using rule 12 (empty_c2)] 'c' [reduce using rule 13 (empty_c3)] start go to state 1 empty_a go to state 2 empty_b go to state 3 empty_c1 go to state 4 empty_c2 go to state 5 empty_c3 go to state 6 Conflict between rule 9 and token 'a' resolved as an error (%nonassoc 'a'). Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b'). Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c'). State 1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1912" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'conflicts.at:1920' \ "%expect-rr non GLR" " " 9 at_xfail=no ( $as_echo "238. $at_setup_line: testing $at_desc ..." $at_traceon cat >1.y <<'_ATEOF' %expect-rr 0 %% exp: 'a' _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv 1.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1930" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 1.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 1.y" "conflicts.at:1930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1930" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1930: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1930" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1930" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1930: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1930" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1930" $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:1930: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret 1.y" at_fn_check_prepare_trace "conflicts.at:1930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.y: warning: %expect-rr applies only to GLR parsers [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1930" $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:1930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Werror" "conflicts.at:1930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1930" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' 1.y: warning: %expect-rr applies only to GLR parsers [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1930: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1930" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1930" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=error" "conflicts.at:1930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1930" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Wnone,none -Werror --trace=none" "conflicts.at:1930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1930" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=none -Werror --trace=none" "conflicts.at:1930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1930" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi cat >2.y <<'_ATEOF' %expect-rr 1 %% exp: 'a' | 'a'; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:1942: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv 2.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1942" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1942" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1942: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 2.y" "conflicts.at:1942" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1942" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1942: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1942" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1942" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1942: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1942" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1942" $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:1942: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret 2.y" at_fn_check_prepare_trace "conflicts.at:1942" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "2.y: warning: %expect-rr applies only to GLR parsers [-Wother] 2.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] 2.y:3.12-14: warning: rule useless in parser due to conflicts [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1942" $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:1942: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Werror" "conflicts.at:1942" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1942" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' 2.y: warning: %expect-rr applies only to GLR parsers [-Wother] 2.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] 2.y:3.12-14: warning: rule useless in parser due to conflicts [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1942: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1942" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1942" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1942: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=error" "conflicts.at:1942" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1942" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1942: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Wnone,none -Werror --trace=none" "conflicts.at:1942" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1942" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1942: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=none -Werror --trace=none" "conflicts.at:1942" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1942" $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_238 #AT_START_239 at_fn_group_banner 239 'conflicts.at:1951' \ "-W versus %expect and %expect-rr" " " 9 at_xfail=no ( $as_echo "239. $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:1977: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv sr-rr.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1977" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:1977" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1977: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml sr-rr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml sr-rr.y" "conflicts.at:1977" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1977" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1977: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1977" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1977" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1977: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1977" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1977" $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:1977: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret sr-rr.y" at_fn_check_prepare_trace "conflicts.at:1977" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1977" $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:1977: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Werror" "conflicts.at:1977" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1977" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1977: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1977" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1977" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1977: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=error" "conflicts.at:1977" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1977" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1977: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Wnone,none -Werror --trace=none" "conflicts.at:1977" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1977" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1977: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=none -Werror --trace=none" "conflicts.at:1977" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1977" $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:1980: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-conflicts-sr sr-rr.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1980" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1980" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1980: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" "conflicts.at:1980" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1980" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1980: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1980" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1980" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1980: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1980" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1980" $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:1980: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y" at_fn_check_prepare_trace "conflicts.at:1980" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1980" $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:1980: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Werror" "conflicts.at:1980" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1980" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1980: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1980" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1980" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1980: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=error" "conflicts.at:1980" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1980" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1980: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone,none -Werror --trace=none" "conflicts.at:1980" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1980" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1980: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror --trace=none" "conflicts.at:1980" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1980" $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:1983: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-conflicts-rr sr-rr.y" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1983" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1983" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1983: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" "conflicts.at:1983" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1983" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:1983: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1983" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1983" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:1983: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1983" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1983" $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:1983: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y" at_fn_check_prepare_trace "conflicts.at:1983" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1983" $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:1983: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Werror" "conflicts.at:1983" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1983" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/conflicts.at:1983: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1983" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1983" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/conflicts.at:1983: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=error" "conflicts.at:1983" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1983" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/conflicts.at:1983: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone,none -Werror --trace=none" "conflicts.at:1983" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1983" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:1983: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror --trace=none" "conflicts.at:1983" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1983" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi # This is piece of code is rather complex for a simple task: try every # combination of (0 or 1 real SR) x (0 or 1 real RR) x (don't %expect # or %expect 0, 1, or 2 SR) x (don't %expect-rr or %expect-rr 0, 1, or 2 # RR). # Number and types of genuine conflicts in the grammar. for gram in sr-rr sr rr; do # Number of expected s/r conflicts. for sr_exp_i in '' 0 1 2; do # Number of expected r/r conflicts. for rr_exp_i in '' 0 1 2; do test -z "$sr_exp_i" && test -z "$rr_exp_i" && continue # Build grammar file. sr_exp=0 rr_exp=0 file=$gram directives= if test -n "$sr_exp_i"; then sr_exp=$sr_exp_i file=$file-expect-$sr_exp directives="%expect $sr_exp" fi if test -n "$rr_exp_i"; then rr_exp=$rr_exp_i file=$file-expect-rr-$rr_exp directives="$directives %expect-rr $rr_exp" fi file=$file.y echo "$directives" > $file cat $gram.y >> $file # Number of found conflicts. case $gram in (sr) sr_count=1; rr_count=0;; (rr) sr_count=0; rr_count=1;; (sr-rr) sr_count=1; rr_count=1;; esac # Update number of expected conflicts: if %expect is given then # %expect-rr defaults to 0, and vice-versa. Leave empty if # nothing expected. case $sr_exp_i:$rr_exp_i in ?:) rr_exp_i=0;; :?) sr_exp_i=0;; esac # Run tests. if test $sr_count -eq $sr_exp && test $rr_count -eq $rr_exp; then if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/conflicts.at:2035: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wnone \$file" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2035" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2035" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:2035: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wnone \$file" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wnone $file" "conflicts.at:2035" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wnone $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2035" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:2035: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2035" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2035" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:2035: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2035" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2035" $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:2035: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wnone \$file" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wnone $file" "conflicts.at:2035" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wnone $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2035" $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:2036: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Werror \$file" at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2036" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:2036" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:2036: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror \$file" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror $file" "conflicts.at:2036" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2036" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/conflicts.at:2036: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:2036" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2036" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/conflicts.at:2036: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:2036" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:2036" $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:2036: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Werror \$file" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Werror $file" "conflicts.at:2036" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Werror $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2036" $at_failed && at_fn_log_failure $at_traceon; } else { if test -z "$sr_exp_i" && test "$sr_count" -ne 0; then echo "warning: $sr_count shift/reduce conflicts" elif test "$sr_exp_i" -ne "$sr_count"; then echo "error: shift/reduce conflicts: $sr_count found, $sr_exp_i expected" fi if test -z "$rr_exp_i" && test "$rr_count" -ne 0; then echo "warning: $rr_count reduce/reduce conflicts" elif test "$rr_exp_i" -ne "$rr_count"; then echo "error: reduce/reduce conflicts: $rr_count found, $rr_exp_i expected" fi } | sed -e "s/^/$file: /" > experr { set +x $as_echo "$at_srcdir/conflicts.at:2050: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wnone \$file" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wnone $file" "conflicts.at:2050" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wnone $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2050" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/conflicts.at:2051: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror \$file" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror $file" "conflicts.at:2051" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror $file ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2051" $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_239 #AT_START_240 at_fn_group_banner 240 'synclines.at:207' \ "Prologue syncline" " " 10 at_xfail=no ( $as_echo "240. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %{ #error "2" %} %code { 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:207: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:207" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:207" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:207: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:207" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:207" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:207: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:207" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:207" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:207: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:207" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:207" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:207: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:207" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:207" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:207: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:207" ( $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:207" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:207: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:207" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:207" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:207: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:207" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || 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:207" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:207: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:207" ( $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:207" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:207: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:207" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:207" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:207: cat stdout" at_fn_check_prepare_trace "synclines.at:207" ( $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:207" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'synclines.at:228' \ "%union syncline" " " 10 at_xfail=no ( $as_echo "241. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %union { #error "2" char dummy; } %code { 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:228: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:228" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:228: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:228" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:228" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:228: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:228" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:228" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:228: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:228" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:228: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:228" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:228" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:228: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:228" ( $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:228" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:228: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:228" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:228: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:228" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || 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:228" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:228: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:228" ( $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:228" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:228: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:228" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:228" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:228: cat stdout" at_fn_check_prepare_trace "synclines.at:228" ( $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: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_241 #AT_START_242 at_fn_group_banner 242 'synclines.at:237' \ "%union name syncline" " " 10 at_xfail=no ( $as_echo "242. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %union break { char dummy; } %code { 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:253: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:253" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:253" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:253: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:253" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:253" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:253: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:253" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:253" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:253: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:253" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:253" $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:253: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:253" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:253" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:254: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:254" ( $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:254" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:254: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:254" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:254" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:254: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:254" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || 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:254" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:254: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:254" ( $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:254" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:254: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:254" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:254" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:255: grep '^input.y:1' stdout" at_fn_check_prepare_trace "synclines.at:255" ( $at_check_trace; grep '^input.y:1' stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:255" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'synclines.at:284' \ "Postprologue syncline" " " 10 at_xfail=no ( $as_echo "243. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code { void yyerror (const char *msg); int yylex (void); } %{ /* Preprologue. */ %} %union { int ival; } %{ #error "13" %} %% 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:284: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:284" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:284: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:284" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:284: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:284" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:284: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:284" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:284: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:284" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:284: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:284" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:284: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:284" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:284: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:284" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:284: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:284" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:284: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:284" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:284: cat stdout" at_fn_check_prepare_trace "synclines.at:284" ( $at_check_trace; cat stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "input.y:13: #error \"13\" " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:284" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_243 #AT_START_244 at_fn_group_banner 244 'synclines.at:303' \ "Action syncline" " " 10 at_xfail=no ( $as_echo "244. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code { 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:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:303" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:303: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:303" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:303" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:303: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:303" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:303: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:303" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:303: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:303" ( $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:303" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:303: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:303" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:303: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:303" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || 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:303" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:303: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:303" ( $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:303" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:303: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:303" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:303: cat stdout" at_fn_check_prepare_trace "synclines.at:303" ( $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:303" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'synclines.at:321' \ "Epilogue syncline" " " 10 at_xfail=no ( $as_echo "245. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code { 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:321: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:321" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:321" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:321: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:321" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:321" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:321: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:321" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:321" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:321: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:321" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:321" $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:321: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:321" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:321" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:321: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:321" ( $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:321" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:321: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:321" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:321" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:321: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:321" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || 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:321" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:321: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:321" ( $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:321" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:321: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:321" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:321" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:321: cat stdout" at_fn_check_prepare_trace "synclines.at:321" ( $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:321" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_245 #AT_START_246 at_fn_group_banner 246 'synclines.at:340' \ "%code top syncline" " " 10 at_xfail=no ( $as_echo "246. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { #error "2" } %code { 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:340: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:340: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:340" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:340: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:340" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:340" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:340: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:340" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:340: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:340" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:340: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:340" ( $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:340" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:340: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:340" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:340: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:340" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || 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:340" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:340: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:340" ( $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:340" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:340: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:340" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:340: cat stdout" at_fn_check_prepare_trace "synclines.at:340" ( $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:340" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'synclines.at:363' \ "%destructor syncline" " " 10 at_xfail=no ( $as_echo "247. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %destructor { #error "2" } %{ void yyerror (const char *msg); int yylex (void); %} %union { int ival; } %type exp %% exp: '0' { $$ = 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:363: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:363" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:363" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:363: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:363" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:363" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:363: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:363" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:363" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:363: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:363" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:363" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/synclines.at:363: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:363" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:363" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:363: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:363" ( $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:363" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:363: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:363" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:363" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:363: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:363" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || 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:363" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:363: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:363" ( $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:363" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:363: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:363" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:363" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:363: cat stdout" at_fn_check_prepare_trace "synclines.at:363" ( $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:363" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'synclines.at:388' \ "%printer syncline" " " 10 at_xfail=no ( $as_echo "248. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %printer { #error "2" } %debug %code { void yyerror (const char *msg); int yylex (void); } %union { int ival; } %type exp %% exp: '0' { $$ = 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:388: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:388" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:388" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:388: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:388" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:388" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:388: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:388" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:388" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:388: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:388" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:388" $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:388: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:388" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:388" $at_failed && at_fn_log_failure $at_traceon; } # Check if we can trust location translation. cat >syncline.c <<'_ATEOF' void foo (void); void foo (void) { #error "4" } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:388: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:388" ( $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:388" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:388: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:388" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:388" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:388: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77" at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:388" ( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || 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:388" $at_failed && at_fn_log_failure $at_traceon; } # Then work for real. { set +x $as_echo "$at_srcdir/synclines.at:388: \$CC \$CFLAGS \$CPPFLAGS -c input.c" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:388" ( $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:388" $at_failed && at_fn_log_failure $at_traceon; } # Transform the file 'stderr' into something like this: # # input.y:4: #error "4" # # In case GCC displays column information, strip it down. # # input.y:4:2: #error "4" or # input.y:4.2: #error "4" or # input.y:4:2: error: #error "4" # => # input.y:4: #error "4" # # It may also issue more context information: # # input.y: In function 'yyparse': # input.y:8: #error "8" # => # input.y:4: #error "8" # # The message may include a caret-error (indented by GCC 4.8, # not by clang 3.2): # # input.y:1:2: error: #error "1" # #error "1" # ^ # # Possibly distcc adds its bits. # # distcc[33187] ERROR: compile (null) on localhost failed # syncline.c:1:2: error: #error "1" # distcc[33185] ERROR: compile syncline.c on localhost failed # # or even # # distcc[35882] (dcc_connect_by_name) ERROR: failed to look up host "chrisimac": Unknown host # distcc[35882] Warning: failed to distribute input.c to chrisimac/4, running locally instead # # The compiler might end by the number of messages issued (Clang 3.2): # # syncline.c:1:2: error: "1" # #error "1" # ^ # 1 error generated. # # When c++ is used to compiler C, we might have more messages (Clang 3.2): # # clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated # # # xlc reports things like: # # "input.yy", line 80.21: 1540-0218 (S) The call does not match any parameter list for "operator<<". # "/usr/vacpp/include/iosfwd", line 32.6: 1506-205 (S) #error This file to be used only with IBM VisualAge C++ v4 and later compilers # # Newer GCCs go further and if the function is declared static, complain # that it's not used. # # GCC 7 also underlines the error. # # syncline.c:4:2: error: #error "4" # #error "4" # ^~~~~ # # GCC 9 displays a left-hand margin with the line number: # # syncline.c: In function 'foo': # syncline.c:4:2: error: #error "4" # 4 | #error "4" # | ^~~~~ { set +x $as_echo "$at_srcdir/synclines.at:388: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77 # Remove left-hand margin. s/^[\\d ]{6}\\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\\n *\\^~*\\n//gm; # Number of errors. s/^1 error generated\\.\\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\"). s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm; # Remove column. s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm; # Map all combinations of \"error: \" and \"#error: \" to \"#error \". s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm; EOF " at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:388" ( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77 # Remove left-hand margin. s/^[\d ]{6}\| //gm; # 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 (with possible '~' to underline). s/^ *#error.*\n *\^~*\n//gm; # Number of errors. s/^1 error generated\.\n//gm; # 2. Normalize the lines we kept. # xlc messages. Remove also error identifier (e.g., "1540-0218 (S)"). s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm; # Remove column. s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm; # Map all combinations of "error: " and "#error: " to "#error ". s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm; EOF ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:388" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:388: cat stdout" at_fn_check_prepare_trace "synclines.at:388" ( $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:388" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'synclines.at:440' \ "syncline escapes: yacc.c" " " 10 at_xfail=no ( $as_echo "249. $at_setup_line: testing $at_desc ..." $at_traceon # ICC is unable to handle these file names: it fails to pass them # properly to the linker, and is unable to save a file named this way. # Don't try with such compilers. cat >\"\\\"\".c <<'_ATEOF' int main (void) { return 0; } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:440: \$CC \$CFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".c -o \\\"\\\\\\\"\\\" || exit 77" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".c -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS \"\\\"\".c -o \"\\\"\" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } cat >\"\\\"\".y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "yacc.c" %code { #include static void yyerror (const char *msg); static int yylex (void); } %destructor {} <> %printer {} <> %% exp: '0' %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # Maybe we tried to create a file name that the file system does not # support. $as_echo "synclines.at:440" >"$at_check_line_file" (test ! -f \"\\\"\".y) \ && at_fn_check_skip 77 "$at_srcdir/synclines.at:440" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o \"\\\"\".c \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".c \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:440" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:440" $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:440: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" at_fn_check_prepare_trace "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"\\\"\".c \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:440" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "synclines.at:440" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/synclines.at:440" { set +x $as_echo "$at_srcdir/synclines.at:440: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".c $LIBS" "synclines.at:440" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_249 #AT_START_250 at_fn_group_banner 250 'synclines.at:440' \ "syncline escapes: glr.c" " " 10 at_xfail=no ( $as_echo "250. $at_setup_line: testing $at_desc ..." $at_traceon # ICC is unable to handle these file names: it fails to pass them # properly to the linker, and is unable to save a file named this way. # Don't try with such compilers. cat >\"\\\"\".c <<'_ATEOF' int main (void) { return 0; } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:440: \$CC \$CFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".c -o \\\"\\\\\\\"\\\" || exit 77" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".c -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS \"\\\"\".c -o \"\\\"\" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } cat >\"\\\"\".y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.c" %code { #include static void yyerror (const char *msg); static int yylex (void); } %destructor {} <> %printer {} <> %% exp: '0' %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # Maybe we tried to create a file name that the file system does not # support. $as_echo "synclines.at:440" >"$at_check_line_file" (test ! -f \"\\\"\".y) \ && at_fn_check_skip 77 "$at_srcdir/synclines.at:440" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o \"\\\"\".c \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".c \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:440" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:440" $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:440: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" at_fn_check_prepare_trace "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"\\\"\".c \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:440" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "synclines.at:440" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/synclines.at:440" { set +x $as_echo "$at_srcdir/synclines.at:440: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".c $LIBS" "synclines.at:440" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_250 #AT_START_251 at_fn_group_banner 251 'synclines.at:440' \ "syncline escapes: lalr1.cc" " " 10 at_xfail=no ( $as_echo "251. $at_setup_line: testing $at_desc ..." $at_traceon # ICC is unable to handle these file names: it fails to pass them # properly to the linker, and is unable to save a file named this way. # Don't try with such compilers. cat >\"\\\"\".cc <<'_ATEOF' int main (void) { return 0; } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:440: \$CXX \$CXXFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS \"\\\"\".cc -o \"\\\"\" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } cat >\"\\\"\".y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %code { static int yylex (yy::parser::semantic_type *lvalp); } %destructor {} <> %printer {} <> %% exp: '0' %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = ""; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF # Maybe we tried to create a file name that the file system does not # support. $as_echo "synclines.at:440" >"$at_check_line_file" (test ! -f \"\\\"\".y) \ && at_fn_check_skip 77 "$at_srcdir/synclines.at:440" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o \"\\\"\".cc \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".cc \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:440" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:440" $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:440: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" at_fn_check_prepare_trace "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"\\\"\".cc \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:440" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "synclines.at:440" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/synclines.at:440" { set +x $as_echo "$at_srcdir/synclines.at:440: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc $LIBS" "synclines.at:440" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".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/synclines.at:440" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_251 #AT_START_252 at_fn_group_banner 252 'synclines.at:440' \ "syncline escapes: glr.cc" " " 10 at_xfail=no ( $as_echo "252. $at_setup_line: testing $at_desc ..." $at_traceon # ICC is unable to handle these file names: it fails to pass them # properly to the linker, and is unable to save a file named this way. # Don't try with such compilers. cat >\"\\\"\".cc <<'_ATEOF' int main (void) { return 0; } _ATEOF { set +x $as_echo "$at_srcdir/synclines.at:440: \$CXX \$CXXFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS \"\\\"\".cc -o \"\\\"\" || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } cat >\"\\\"\".y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.cc" %code { static int yylex (yy::parser::semantic_type *lvalp); } %destructor {} <> %printer {} <> %% exp: '0' %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = ""; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF # Maybe we tried to create a file name that the file system does not # support. $as_echo "synclines.at:440" >"$at_check_line_file" (test ! -f \"\\\"\".y) \ && at_fn_check_skip 77 "$at_srcdir/synclines.at:440" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o \"\\\"\".cc \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".cc \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:440" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:440" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:440: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:440" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:440" $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:440: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" at_fn_check_prepare_trace "synclines.at:440" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o \"\\\"\".cc \"\\\"\".y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:440" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "synclines.at:440" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/synclines.at:440" { set +x $as_echo "$at_srcdir/synclines.at:440: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc $LIBS" "synclines.at:440" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".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/synclines.at:440" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_252 #AT_START_253 at_fn_group_banner 253 'synclines.at:497' \ "%no-lines: yacc.c" " " 10 at_xfail=no ( $as_echo "253. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "yacc.c" %defines %{ void yyerror (const char *msg); int yylex (void); %} %union { int ival; } %% exp: '0' _ATEOF # Generate without.* without the #line. Don't use -o without.c which # would change the content (e.g., CPP guard depend on the output file # name). if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-lines -o input.c -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-lines -o input.c -d input.y" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.c without.c" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.c without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.h without.h" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.h without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # There is no #line at all. { set +x $as_echo "$at_srcdir/synclines.at:497: grep '#line' *.c *.h" at_fn_check_prepare_trace "synclines.at:497" ( $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:497" $at_failed && at_fn_log_failure $at_traceon; } # Generate with.* without the #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y" "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -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:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -d input.y" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.c with.c" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.c with.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.h with.h" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.h with.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # The implementation file with --no-line is exactly the # original one with #lines removed. { set +x $as_echo "$at_srcdir/synclines.at:497: grep -v '#line' with.c >expout" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; grep -v '#line' with.c >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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: cat without.c" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; cat without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # Likewise for the header. { set +x $as_echo "$at_srcdir/synclines.at:497: grep -v '#line' with.h >expout" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; grep -v '#line' with.h >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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: cat without.h" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; cat without.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_253 #AT_START_254 at_fn_group_banner 254 'synclines.at:497' \ "%no-lines: glr.c" " " 10 at_xfail=no ( $as_echo "254. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.c" %defines %{ void yyerror (const char *msg); int yylex (void); %} %union { int ival; } %% exp: '0' _ATEOF # Generate without.* without the #line. Don't use -o without.c which # would change the content (e.g., CPP guard depend on the output file # name). if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-lines -o input.c -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-lines -o input.c -d input.y" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-lines -o input.c -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.c without.c" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.c without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.h without.h" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.h without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # There is no #line at all. { set +x $as_echo "$at_srcdir/synclines.at:497: grep '#line' *.c *.h" at_fn_check_prepare_trace "synclines.at:497" ( $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:497" $at_failed && at_fn_log_failure $at_traceon; } # Generate with.* without the #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y" "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -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:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -d input.y" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.c with.c" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.c with.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.h with.h" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.h with.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # The implementation file with --no-line is exactly the # original one with #lines removed. { set +x $as_echo "$at_srcdir/synclines.at:497: grep -v '#line' with.c >expout" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; grep -v '#line' with.c >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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: cat without.c" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; cat without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # Likewise for the header. { set +x $as_echo "$at_srcdir/synclines.at:497: grep -v '#line' with.h >expout" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; grep -v '#line' with.h >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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: cat without.h" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; cat without.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_254 #AT_START_255 at_fn_group_banner 255 'synclines.at:497' \ "%no-lines: lalr1.cc" " " 10 at_xfail=no ( $as_echo "255. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %defines %{ int yylex (yy::parser::semantic_type *lvalp); %} %union { int ival; } %% exp: '0' _ATEOF # Generate without.* without the #line. Don't use -o without.c which # would change the content (e.g., CPP guard depend on the output file # name). if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-lines -o input.cc -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.cc without.cc" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.cc without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.hh without.hh" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.hh without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # There is no #line at all. { set +x $as_echo "$at_srcdir/synclines.at:497: grep '#line' *.cc *.hh" at_fn_check_prepare_trace "synclines.at:497" ( $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:497" $at_failed && at_fn_log_failure $at_traceon; } # Generate with.* without the #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y" "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -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:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc -d input.y" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.cc with.cc" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.cc with.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.hh with.hh" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.hh with.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # The implementation file with --no-line is exactly the # original one with #lines removed. { set +x $as_echo "$at_srcdir/synclines.at:497: grep -v '#line' with.cc >expout" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; grep -v '#line' with.cc >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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: cat without.cc" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; cat without.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } # Likewise for the header. { set +x $as_echo "$at_srcdir/synclines.at:497: grep -v '#line' with.hh >expout" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; grep -v '#line' with.hh >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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: cat without.hh" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; cat without.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_255 #AT_START_256 at_fn_group_banner 256 'synclines.at:497' \ "%no-lines: glr.cc" " " 10 at_xfail=no ( $as_echo "256. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.cc" %defines %{ int yylex (yy::parser::semantic_type *lvalp); %} %union { int ival; } %% exp: '0' _ATEOF # Generate without.* without the #line. Don't use -o without.c which # would change the content (e.g., CPP guard depend on the output file # name). if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-lines -o input.cc -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.cc without.cc" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.cc without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.hh without.hh" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.hh without.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # There is no #line at all. { set +x $as_echo "$at_srcdir/synclines.at:497: grep '#line' *.cc *.hh" at_fn_check_prepare_trace "synclines.at:497" ( $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:497" $at_failed && at_fn_log_failure $at_traceon; } # Generate with.* without the #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc -d input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y" "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -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:497" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:497" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/synclines.at:497: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc -d input.y" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -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:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.cc with.cc" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.cc with.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: mv input.hh with.hh" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; mv input.hh with.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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } # The implementation file with --no-line is exactly the # original one with #lines removed. { set +x $as_echo "$at_srcdir/synclines.at:497: grep -v '#line' with.cc >expout" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; grep -v '#line' with.cc >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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: cat without.cc" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; cat without.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } # Likewise for the header. { set +x $as_echo "$at_srcdir/synclines.at:497: grep -v '#line' with.hh >expout" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; grep -v '#line' with.hh >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/synclines.at:497" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:497: cat without.hh" at_fn_check_prepare_trace "synclines.at:497" ( $at_check_trace; cat without.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:497" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_256 #AT_START_257 at_fn_group_banner 257 'synclines.at:507' \ "Output columns" " " 10 at_xfail=no ( $as_echo "257. $at_setup_line: testing $at_desc ..." $at_traceon # This test is fragile: its point is to check the compiler's error # message, but it seems too hard to do portability (even between # version of GCC). So instead, let's just check the generated code # itself. cat >input.y <<'_ATEOF' %{ void yyerror (const char *msg); int yylex (void); %} %define api.value.type union %type '0' exp %destructor { /* --BEGIN */ destructor /* --END */ } <*> %printer { /* --BEGIN */ printer /* --END */ } <*> %left '+' %% exp: exp '+' exp { /* --BEGIN */ $$ = $1 + $3; @$ = @1 + @3; /* --END */ } | '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:540: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:540" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:540" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:540: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:540" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:540" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/synclines.at:540: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:540" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:540" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/synclines.at:540: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:540" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:540" $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:540: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "synclines.at:540" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:540" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/synclines.at:561: sed -ne '/--BEGIN/,/--END/{' \\ -e '/input.c/s/ [0-9]* / LINE /;' \\ -e 'p;}' \\ input.c" at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:561" ( $at_check_trace; sed -ne '/--BEGIN/,/--END/{' \ -e '/input.c/s/ [0-9]* / LINE /;' \ -e '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 >>"$at_stdout"; $as_echo " { /* --BEGIN */ printer /* --END */ } { /* --BEGIN */ printer /* --END */ } { /* --BEGIN */ destructor /* --END */ } { /* --BEGIN */ destructor /* --END */ } { /* --BEGIN */ (yyval.exp) = (yyvsp[-2].exp) + (yyvsp[0].exp); (yyloc) = (yylsp[-2]) + (yylsp[0]); /* --END */ } " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/synclines.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_257 #AT_START_258 at_fn_group_banner 258 'headers.at:57' \ "Invalid CPP guards: --defines=input/input.h" " " 11 at_xfail=no ( $as_echo "258. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include void yyerror (const char *msg); int yylex (void); %} %% dummy: %empty; %% #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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --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; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:57" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/headers.at:57: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_trace "headers.at:57" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:57" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:57" { 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_258 #AT_START_259 at_fn_group_banner 259 'headers.at:58' \ "Invalid CPP guards: --defines=9foo.h" " " 11 at_xfail=no ( $as_echo "259. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include <9foo.h> void yyerror (const char *msg); int yylex (void); %} %% dummy: %empty; %% #include <9foo.h> _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:58: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:58" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:58" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/headers.at:58: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_trace "headers.at:58" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:58" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:58" { 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_259 #AT_START_260 at_fn_group_banner 260 'headers.at:59' \ "Invalid CPP guards: %glr-parser --defines=input/input.h" "" 11 at_xfail=no ( $as_echo "260. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %glr-parser %{ #include void yyerror (const char *msg); int yylex (void); %} %% dummy: %empty; %% #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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --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; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:59" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:59: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/headers.at:59: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=input/input.h --output=input/input.c input/input.y" at_fn_check_prepare_trace "headers.at:59" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=input/input.h --output=input/input.c input/input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:59" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:59" { 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_260 #AT_START_261 at_fn_group_banner 261 'headers.at:60' \ "Invalid CPP guards: %glr-parser --defines=9foo.h" "" 11 at_xfail=no ( $as_echo "261. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %glr-parser %{ #include <9foo.h> void yyerror (const char *msg); int yylex (void); %} %% dummy: %empty; %% #include <9foo.h> _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:60: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:60" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:60" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/headers.at:60: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=9foo.h --output=9foo.c 9foo.y" at_fn_check_prepare_trace "headers.at:60" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines=9foo.h --output=9foo.c 9foo.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:60" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:60" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:60" { 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_261 #AT_START_262 at_fn_group_banner 262 'headers.at:68' \ "export YYLTYPE" " " 11 at_xfail=no ( $as_echo "262. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %name-prefix "my_" %{ #include #include /* A C error reporting function. */ static void my_error (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int my_lex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } %} %% exp: %empty; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/headers.at:89: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:89" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:89: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines -o input.c input.y" "headers.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:89" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:89: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:89" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:89" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:89: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:89" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:89" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:89: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --defines -o input.c input.y" at_fn_check_prepare_trace "headers.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --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:11.1-18: warning: deprecated directive: '%name-prefix \"my_\"', use '%define api.prefix {my_}' [-Wdeprecated] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:89" $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/headers.at:89: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y -Werror" "headers.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --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/headers.at:89" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:11.1-18: warning: deprecated directive: '%name-prefix "my_"', use '%define api.prefix {my_}' [-Wdeprecated] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/headers.at:89: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "headers.at:89" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:89" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/headers.at:89: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y --warnings=error" "headers.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --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/headers.at:89" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/headers.at:89: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y -Wnone,none -Werror --trace=none" "headers.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:89" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:89: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y --warnings=none -Werror --trace=none" "headers.at:89" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:89" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi # YYLTYPE should be defined, and MY_LLOC declared. cat >caller.c <<'_ATEOF' #include "input.h" YYLTYPE *my_llocp = &my_lloc; int my_parse (void); #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return my_parse (); } _ATEOF # Link and execute, just to make sure everything is fine (and in # particular, that MY_LLOC is indeed defined somewhere). $as_echo "headers.at:103" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:103" { set +x $as_echo "$at_srcdir/headers.at:103: \$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:103" ( $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:103" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:104" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:104" { set +x $as_echo "$at_srcdir/headers.at:104: \$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:104" ( $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:104" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:105" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:105" { set +x $as_echo "$at_srcdir/headers.at:105: \$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:105" ( $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:105" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:106: \$PREPARSER ./caller" at_fn_check_prepare_dynamic " $PREPARSER ./caller" "headers.at:106" ( $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:106" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:106: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "headers.at:106" ( $at_check_trace; 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:106" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'headers.at:176' \ "Sane headers: " " " 11 at_xfail=no ( $as_echo "263. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %union {int integer;} %code { #include /* printf. */ #include static void yyerror (const char *msg); static int yylex (void); } %% exp: 'x' { printf ("x\n"); } ; %% /* 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[] = "x"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:176: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:176" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:176: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:176" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:176: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:176" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:176" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:176: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:176" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:176: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.c input.y" at_fn_check_prepare_trace "headers.at:176" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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:176" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:176" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:176" { set +x $as_echo "$at_srcdir/headers.at:176: \$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:176" ( $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:176" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # 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 do # No shell expansion with AT_DATA. cat >$h.c < #include "$h" #include "$h" EOF $as_echo "headers.at:176" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:176" { set +x $as_echo "$at_srcdir/headers.at:176: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:176" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.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:176" $at_failed && at_fn_log_failure $at_traceon; } 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_263 #AT_START_264 at_fn_group_banner 264 'headers.at:177' \ "Sane headers: %locations %debug" " " 11 at_xfail=no ( $as_echo "264. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %define parse.error verbose %union {int integer;} %code { #include /* printf. */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %% exp: 'x' { printf ("x\n"); } ; %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "x"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).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:177: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:177" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:177" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:177: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:177" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:177" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:177: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:177" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:177" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:177: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:177" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:177: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.c input.y" at_fn_check_prepare_trace "headers.at:177" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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:177" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:177" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:177" { set +x $as_echo "$at_srcdir/headers.at:177: \$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:177" ( $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:177" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF # 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 do # No shell expansion with AT_DATA. cat >$h.c < #include "$h" #include "$h" EOF $as_echo "headers.at:177" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:177" { set +x $as_echo "$at_srcdir/headers.at:177: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:177" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.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:177" $at_failed && at_fn_log_failure $at_traceon; } 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_264 #AT_START_265 at_fn_group_banner 265 'headers.at:179' \ "Sane headers: %glr-parser" " " 11 at_xfail=no ( $as_echo "265. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %glr-parser %define parse.error verbose %union {int integer;} %code { #include /* printf. */ #include static void yyerror (const char *msg); static int yylex (void); } %% exp: 'x' { printf ("x\n"); } ; %% /* 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[] = "x"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:179: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:179" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:179" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:179: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:179" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:179" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:179: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:179" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:179" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:179: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:179" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:179" $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:179: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.c input.y" at_fn_check_prepare_trace "headers.at:179" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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:179" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:179" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:179" { set +x $as_echo "$at_srcdir/headers.at:179: \$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:179" ( $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:179" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # 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 do # No shell expansion with AT_DATA. cat >$h.c < #include "$h" #include "$h" EOF $as_echo "headers.at:179" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:179" { set +x $as_echo "$at_srcdir/headers.at:179: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:179" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.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:179" $at_failed && at_fn_log_failure $at_traceon; } 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_265 #AT_START_266 at_fn_group_banner 266 'headers.at:180' \ "Sane headers: %locations %debug %glr-parser" " " 11 at_xfail=no ( $as_echo "266. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %glr-parser %define parse.error verbose %union {int integer;} %code { #include /* printf. */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %% exp: 'x' { printf ("x\n"); } ; %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "x"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).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:180: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:180" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:180" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:180: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:180" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:180" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:180: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:180" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:180" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:180: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:180" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:180: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.c input.y" at_fn_check_prepare_trace "headers.at:180" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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:180" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:180" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:180" { set +x $as_echo "$at_srcdir/headers.at:180: \$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:180" ( $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:180" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF # 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 do # No shell expansion with AT_DATA. cat >$h.c < #include "$h" #include "$h" EOF $as_echo "headers.at:180" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:180" { set +x $as_echo "$at_srcdir/headers.at:180: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:180" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.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:180" $at_failed && at_fn_log_failure $at_traceon; } 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_266 #AT_START_267 at_fn_group_banner 267 'headers.at:182' \ "Sane headers: api.pure" " " 11 at_xfail=no ( $as_echo "267. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.pure %define parse.error verbose %union {int integer;} %code { #include /* printf. */ #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); } %% exp: 'x' { printf ("x\n"); } ; %% /* 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[] = "x"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:182: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:182" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:182" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:182: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:182" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:182" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:182: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:182" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:182" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:182: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:182" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:182: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.c input.y" at_fn_check_prepare_trace "headers.at:182" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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:182" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:182" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:182" { set +x $as_echo "$at_srcdir/headers.at:182: \$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:182" ( $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:182" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # 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 do # No shell expansion with AT_DATA. cat >$h.c < #include "$h" #include "$h" EOF $as_echo "headers.at:182" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:182" { set +x $as_echo "$at_srcdir/headers.at:182: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:182" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.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:182" $at_failed && at_fn_log_failure $at_traceon; } 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_267 #AT_START_268 at_fn_group_banner 268 'headers.at:183' \ "Sane headers: api.push-pull=both" " " 11 at_xfail=no ( $as_echo "268. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.push-pull both %define parse.error verbose %union {int integer;} %code { #include /* printf. */ #if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__) # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif #include static void yyerror (const char *msg); static int yylex (void); } %% exp: 'x' { printf ("x\n"); } ; %% /* 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[] = "x"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:183: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:183" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:183" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:183: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:183" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:183" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:183: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:183" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:183" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:183: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:183" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:183" $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:183: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.c input.y" at_fn_check_prepare_trace "headers.at:183" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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:183" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:183" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:183" { set +x $as_echo "$at_srcdir/headers.at:183: \$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:183" ( $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:183" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # 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 do # No shell expansion with AT_DATA. cat >$h.c < #include "$h" #include "$h" EOF $as_echo "headers.at:183" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:183" { set +x $as_echo "$at_srcdir/headers.at:183: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:183" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.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:183" $at_failed && at_fn_log_failure $at_traceon; } 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_268 #AT_START_269 at_fn_group_banner 269 'headers.at:184' \ "Sane headers: api.pure api.push-pull=both" " " 11 at_xfail=no ( $as_echo "269. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.pure %define api.push-pull both %define parse.error verbose %union {int integer;} %code { #include /* printf. */ #if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__) # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); } %% exp: 'x' { printf ("x\n"); } ; %% /* 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[] = "x"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:184: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:184" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:184: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:184" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:184: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:184" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:184" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:184: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:184" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:184: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.c input.y" at_fn_check_prepare_trace "headers.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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:184" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:184" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:184" { set +x $as_echo "$at_srcdir/headers.at:184: \$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:184" ( $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:184" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # 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 do # No shell expansion with AT_DATA. cat >$h.c < #include "$h" #include "$h" EOF $as_echo "headers.at:184" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:184" { set +x $as_echo "$at_srcdir/headers.at:184: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c " at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:184" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.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:184" $at_failed && at_fn_log_failure $at_traceon; } 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_269 #AT_START_270 at_fn_group_banner 270 'headers.at:186' \ "Sane headers: c++" " " 11 at_xfail=no ( $as_echo "270. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "c++" %define parse.error verbose %union {int integer;} %code { #include /* printf. */ static int yylex (yy::parser::semantic_type *lvalp); } %% exp: 'x' { printf ("x\n"); } ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "x"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:186: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:186" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -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/headers.at:186" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:186: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" "headers.at:186" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -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/headers.at:186" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:186: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:186" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:186" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:186: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:186" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:186" $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:186: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.cc input.y" at_fn_check_prepare_trace "headers.at:186" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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/headers.at:186" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:186" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:186" { set +x $as_echo "$at_srcdir/headers.at:186: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o input.o input.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o input.o input.cc " "headers.at:186" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o input.o input.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:186" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF # Check that the headers are self-contained, and protected against # multiple inclusions. While at it, check they are sane for C++. for h in *.hh do # No shell expansion with AT_DATA. cat >$h.cc < #include "$h" #include "$h" EOF $as_echo "headers.at:186" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:186" { set +x $as_echo "$at_srcdir/headers.at:186: \$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:186" ( $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:186" $at_failed && at_fn_log_failure $at_traceon; } 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_270 #AT_START_271 at_fn_group_banner 271 'headers.at:187' \ "Sane headers: %locations %debug c++" " " 11 at_xfail=no ( $as_echo "271. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %language "c++" %define parse.error verbose %union {int integer;} %code { #include /* printf. */ static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %% exp: 'x' { printf ("x\n"); } ; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = "x"; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:187: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:187" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -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/headers.at:187" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:187: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" "headers.at:187" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -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/headers.at:187" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:187: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:187" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:187" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:187: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:187" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:187" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:187: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.cc input.y" at_fn_check_prepare_trace "headers.at:187" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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/headers.at:187" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:187" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:187" { set +x $as_echo "$at_srcdir/headers.at:187: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o input.o input.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o input.o input.cc " "headers.at:187" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o input.o input.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:187" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF # Check that the headers are self-contained, and protected against # multiple inclusions. While at it, check they are sane for C++. for h in *.hh do # No shell expansion with AT_DATA. cat >$h.cc < #include "$h" #include "$h" EOF $as_echo "headers.at:187" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:187" { set +x $as_echo "$at_srcdir/headers.at:187: \$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:187" ( $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:187" $at_failed && at_fn_log_failure $at_traceon; } 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_271 #AT_START_272 at_fn_group_banner 272 'headers.at:188' \ "Sane headers: c++ api.value.type=variant parse.assert" "" 11 at_xfail=no ( $as_echo "272. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "c++" %define api.value.type variant %define parse.assert %define parse.error verbose %token 'x' %code { #include /* printf. */ static int yylex (yy::parser::semantic_type *lvalp); } %% exp: 'x' { printf ("x\n"); } ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "x"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:188: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:188" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -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/headers.at:188" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:188: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" "headers.at:188" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -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/headers.at:188" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:188: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:188" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:188" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:188: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:188" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:188" $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:188: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.cc input.y" at_fn_check_prepare_trace "headers.at:188" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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/headers.at:188" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:188" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:188" { set +x $as_echo "$at_srcdir/headers.at:188: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o input.o input.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o input.o input.cc " "headers.at:188" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o input.o input.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:188" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF # Check that the headers are self-contained, and protected against # multiple inclusions. While at it, check they are sane for C++. for h in *.hh do # No shell expansion with AT_DATA. cat >$h.cc < #include "$h" #include "$h" EOF $as_echo "headers.at:188" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:188" { set +x $as_echo "$at_srcdir/headers.at:188: \$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:188" ( $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:188" $at_failed && at_fn_log_failure $at_traceon; } 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_272 #AT_START_273 at_fn_group_banner 273 'headers.at:190' \ "Sane headers: %locations c++ %glr-parser" " " 11 at_xfail=no ( $as_echo "273. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %language "c++" %glr-parser %define parse.error verbose %union {int integer;} %code { #include /* printf. */ static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %% exp: 'x' { printf ("x\n"); } ; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = "x"; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:190: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:190" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -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/headers.at:190" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:190: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" "headers.at:190" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -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/headers.at:190" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:190: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:190" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:190" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:190: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:190" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:190" $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:190: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o input.cc input.y" at_fn_check_prepare_trace "headers.at:190" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -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/headers.at:190" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:190" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:190" { set +x $as_echo "$at_srcdir/headers.at:190: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o input.o input.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o input.o input.cc " "headers.at:190" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o input.o input.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:190" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF # Check that the headers are self-contained, and protected against # multiple inclusions. While at it, check they are sane for C++. for h in *.hh do # No shell expansion with AT_DATA. cat >$h.cc < #include "$h" #include "$h" EOF $as_echo "headers.at:190" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:190" { set +x $as_echo "$at_srcdir/headers.at:190: \$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:190" ( $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:190" $at_failed && at_fn_log_failure $at_traceon; } 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_273 #AT_START_274 at_fn_group_banner 274 'headers.at:198' \ "Several parsers" " " 11 at_xfail=no ( $as_echo "274. $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 after applying api.prefix. Check # that headers can be compiled by a C++ compiler. # AT_TEST cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include // 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 "x9.hh" #define RUN(S) \ do { \ int res = S; \ if (res) \ std::cerr << #S": " << res << '\n'; \ } 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()); x9_::parser p9; RUN(p9.parse()); return 0; } _ATEOF # main.cc cat >x1.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x1_} %define parse.error verbose %union { int integer; } %{ #include /* printf. */ #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"); } | 'x' '9' { printf ("x9\n"); } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:297: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x1.c x1.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:297: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y" "headers.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:297" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:297: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:297" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:297" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:297: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:297" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:297: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x1.c x1.y" at_fn_check_prepare_trace "headers.at:297" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x1.c x1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:297" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:297" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:297" { set +x $as_echo "$at_srcdir/headers.at:297: \$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:297" ( $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:297" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:297: echo \"x1\" >>expout" at_fn_check_prepare_trace "headers.at:297" ( $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:297" $at_failed && at_fn_log_failure $at_traceon; } cat >x2.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x2_} %locations %debug %define parse.error verbose %union { int integer; } %{ #include /* printf. */ #include #if defined X2_LTYPE_IS_TRIVIAL && X2_LTYPE_IS_TRIVIAL static int location_print (FILE *yyo, X2_LTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void x2_error (const char *msg); static int x2_lex (void); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } | 'x' '9' { printf ("x9\n"); } ; %% # if defined X2_LTYPE_IS_TRIVIAL && X2_LTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, X2_LTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void x2_error (const char *msg) { LOCATION_PRINT (stderr, (x2_lloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int x2_lex (void) { static char const input[] = "x2"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:298: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x2.c x2.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:298" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:298" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:298: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y" "headers.at:298" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:298" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:298: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:298" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:298" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:298: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:298" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:298" $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:298: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x2.c x2.y" at_fn_check_prepare_trace "headers.at:298" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x2.c x2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:298" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:298" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:298" { set +x $as_echo "$at_srcdir/headers.at:298: \$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:298" ( $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:298" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:298: echo \"x2\" >>expout" at_fn_check_prepare_trace "headers.at:298" ( $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:298" $at_failed && at_fn_log_failure $at_traceon; } cat >x3.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x3_} %glr-parser %define parse.error verbose %union { int integer; } %{ #include /* printf. */ #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"); } | 'x' '9' { printf ("x9\n"); } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:299: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x3.c x3.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:299" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:299: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y" "headers.at:299" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:299" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:299: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:299" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:299" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:299: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:299" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:299: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x3.c x3.y" at_fn_check_prepare_trace "headers.at:299" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x3.c x3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:299" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:299" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:299" { set +x $as_echo "$at_srcdir/headers.at:299: \$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:299" ( $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:299" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:299: echo \"x3\" >>expout" at_fn_check_prepare_trace "headers.at:299" ( $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:299" $at_failed && at_fn_log_failure $at_traceon; } cat >x4.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x4_} %locations %debug %glr-parser %define parse.error verbose %union { int integer; } %{ #include /* printf. */ #include #if defined X4_LTYPE_IS_TRIVIAL && X4_LTYPE_IS_TRIVIAL static int location_print (FILE *yyo, X4_LTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void x4_error (const char *msg); static int x4_lex (void); %} %% exp: 'x' '1' { printf ("x1\n"); } | 'x' '2' { printf ("x2\n"); } | 'x' '3' { printf ("x3\n"); } | 'x' '4' { printf ("x4\n"); } | 'x' '5' { printf ("x5\n"); } | 'x' '6' { printf ("x6\n"); } | 'x' '7' { printf ("x7\n"); } | 'x' '8' { printf ("x8\n"); } | 'x' '9' { printf ("x9\n"); } ; %% # if defined X4_LTYPE_IS_TRIVIAL && X4_LTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, X4_LTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void x4_error (const char *msg) { LOCATION_PRINT (stderr, (x4_lloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int x4_lex (void) { static char const input[] = "x4"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:300: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x4.c x4.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:300" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:300" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:300: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y" "headers.at:300" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:300" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:300: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:300" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:300" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:300: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:300" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:300: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x4.c x4.y" at_fn_check_prepare_trace "headers.at:300" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x4.c x4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:300" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:300" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:300" { set +x $as_echo "$at_srcdir/headers.at:300: \$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:300" ( $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:300" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:300: echo \"x4\" >>expout" at_fn_check_prepare_trace "headers.at:300" ( $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:300" $at_failed && at_fn_log_failure $at_traceon; } cat >x5.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x5_} %locations %debug %language "c++" %define parse.error verbose %union { int integer; } %{ #include /* printf. */ 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"); } | 'x' '9' { printf ("x9\n"); } ; %% /* A C++ error reporting function. */ void x5_::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int x5_lex (x5_::parser::semantic_type *lvalp, x5_::parser::location_type *llocp) { static char const input[] = "x5"; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:301: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x5.cc x5.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:301" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:301" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:301: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y" "headers.at:301" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:301" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:301: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:301" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:301" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:301: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:301" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:301" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/headers.at:301: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x5.cc x5.y" at_fn_check_prepare_trace "headers.at:301" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x5.cc x5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:301" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:301" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:301" { set +x $as_echo "$at_srcdir/headers.at:301: \$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:301" ( $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:301" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:301: echo \"x5\" >>expout" at_fn_check_prepare_trace "headers.at:301" ( $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:301" $at_failed && at_fn_log_failure $at_traceon; } cat >x6.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x6_} %define api.pure %define parse.error verbose %union { int integer; } %{ #include /* printf. */ #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"); } | 'x' '9' { printf ("x9\n"); } ; %% /* 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 int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:302: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x6.c x6.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:302" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:302" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:302: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y" "headers.at:302" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:302" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:302: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:302" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:302" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:302: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:302" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:302" $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:302: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x6.c x6.y" at_fn_check_prepare_trace "headers.at:302" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x6.c x6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:302" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:302" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:302" { set +x $as_echo "$at_srcdir/headers.at:302: \$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:302" ( $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:302" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:302: echo \"x6\" >>expout" at_fn_check_prepare_trace "headers.at:302" ( $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:302" $at_failed && at_fn_log_failure $at_traceon; } cat >x7.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x7_} %define api.push-pull both %define parse.error verbose %union { int integer; } %{ #include /* printf. */ #if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__) # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif #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"); } | 'x' '9' { printf ("x9\n"); } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x7.c x7.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:303: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y" "headers.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:303" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:303: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:303" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:303" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:303: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:303" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:303: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x7.c x7.y" at_fn_check_prepare_trace "headers.at:303" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x7.c x7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:303" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:303" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:303" { set +x $as_echo "$at_srcdir/headers.at:303: \$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:303" ( $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:303" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:303: echo \"x7\" >>expout" at_fn_check_prepare_trace "headers.at:303" ( $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:303" $at_failed && at_fn_log_failure $at_traceon; } cat >x8.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x8_} %define api.pure %define api.push-pull both %define parse.error verbose %union { int integer; } %{ #include /* printf. */ #if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__) # pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif #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"); } | 'x' '9' { printf ("x9\n"); } ; %% /* 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 int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:304: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x8.c x8.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:304" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:304: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y" "headers.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:304" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:304: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:304" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:304" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:304: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:304" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:304" $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:304: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x8.c x8.y" at_fn_check_prepare_trace "headers.at:304" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x8.c x8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:304" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:304" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:304" { set +x $as_echo "$at_srcdir/headers.at:304: \$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:304" ( $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:304" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:304: echo \"x8\" >>expout" at_fn_check_prepare_trace "headers.at:304" ( $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:304" $at_failed && at_fn_log_failure $at_traceon; } cat >x9.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define api.prefix {x9_} %locations %code requires {#include "location.hh"} %define api.location.type {x5_::location} %debug %language "c++" %define parse.error verbose %union { int integer; } %{ #include /* printf. */ static int x9_lex (x9_::parser::semantic_type *lvalp, x9_::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"); } | 'x' '9' { printf ("x9\n"); } ; %% /* A C++ error reporting function. */ void x9_::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int x9_lex (x9_::parser::semantic_type *lvalp, x9_::parser::location_type *llocp) { static char const input[] = "x9"; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:305: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -o x9.cc x9.y" at_fn_check_prepare_notrace 'an embedded newline' "headers.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -o x9.cc x9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:305" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:305: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x9.cc x9.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x9.cc x9.y" "headers.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x9.cc x9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:305" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/headers.at:305: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:305" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:305" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/headers.at:305: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:305" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/headers.at:305: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x9.cc x9.y" at_fn_check_prepare_trace "headers.at:305" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -o x9.cc x9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:305" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:305" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:305" { set +x $as_echo "$at_srcdir/headers.at:305: \$CXX \$CXXFLAGS \$CPPFLAGS -c -o x9.o x9.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -c -o x9.o x9.cc " "headers.at:305" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -c -o x9.o x9.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:305" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:305: echo \"x9\" >>expout" at_fn_check_prepare_trace "headers.at:305" ( $at_check_trace; echo "x9" >>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:305" $at_failed && at_fn_log_failure $at_traceon; } #AT_TEST([x5], [%locations %language "c++" %glr-parser]) # Check that api.prefix works properly: # # - no 'yy' left. # C++ output relies on namespaces and still uses yy a lot. # # - no 'YY' left. # Ignore comments, YYChar (template parameter), YYPUSH_MORE(_DEFINED)? # (constant definition), YY_\w+_INCLUDED (header guards). # YYDEBUG (not renamed) can be read, but not changed. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/headers.at:351: \"\$PERL\" -n -0777 -e ' s{/\\*.*?\\*/}{}gs; s{//.*}{}g; s{\\b((defined|if)\\ YYDEBUG |YYChar |YYPUSH_MORE(?:_DEFINED)? |YYUSE |YY_ATTRIBUTE(?:_PURE|_UNUSED) |YY(?:_REINTERPRET)?_CAST |YY_CONSTEXPR |YY_COPY |YY_CPLUSPLUS |YY_IGNORE_(?:MAYBE_UNINITIALIZED|USELESS_CAST)_(?:BEGIN|END) |YY_INITIAL_VALUE |YY_MOVE |YY_MOVE_OR_COPY |YY_MOVE_REF |YY_NOEXCEPT |YY_NOTHROW |YY_NULLPTR |YY_RVREF |YY_\\w+_INCLUDED )\\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:351" ( $at_check_trace; "$PERL" -n -0777 -e ' s{/\*.*?\*/}{}gs; s{//.*}{}g; s{\b((defined|if)\ YYDEBUG |YYChar |YYPUSH_MORE(?:_DEFINED)? |YYUSE |YY_ATTRIBUTE(?:_PURE|_UNUSED) |YY(?:_REINTERPRET)?_CAST |YY_CONSTEXPR |YY_COPY |YY_CPLUSPLUS |YY_IGNORE_(?:MAYBE_UNINITIALIZED|USELESS_CAST)_(?:BEGIN|END) |YY_INITIAL_VALUE |YY_MOVE |YY_MOVE_OR_COPY |YY_MOVE_REF |YY_NOEXCEPT |YY_NOTHROW |YY_NULLPTR |YY_RVREF |YY_\w+_INCLUDED )\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:351" $at_failed && at_fn_log_failure $at_traceon; } fi # 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 $as_echo "headers.at:354" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:354" { set +x $as_echo "$at_srcdir/headers.at:354: \$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:354" ( $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:354" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:354" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:354" { set +x $as_echo "$at_srcdir/headers.at:354: \$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:354" ( $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:354" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:354: \$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:354" ( $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 echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/headers.at:354" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:354: \$PREPARSER ./c-and-cxx" at_fn_check_prepare_dynamic " $PREPARSER ./c-and-cxx" "headers.at:354" ( $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:354" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "headers.at:354" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/headers.at:354" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "headers.at:356" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/headers.at:356" { set +x $as_echo "$at_srcdir/headers.at:356: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o parser x[1-9].o -DCC_IS_CXX=\$CC_IS_CXX main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-9].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS" "headers.at:356" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o parser x[1-9].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:356" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:357: \$PREPARSER ./parser" at_fn_check_prepare_dynamic " $PREPARSER ./parser" "headers.at:357" ( $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:357" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/headers.at:357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "headers.at:357" ( $at_check_trace; 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:357" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:24' \ "Midrule actions" " " 12 at_xfail=no ( $as_echo "275. $at_setup_line: testing $at_desc ..." $at_traceon # Bison once forgot the midrule actions. It was because the action # was attached to the host rule (the one with the midrule action), # instead of being attached to the empty rule dedicated to this # action. cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %debug %code { #include static void yyerror (const char *msg); static int yylex (void); } %% exp: { putchar ('0'); } '1' { putchar ('1'); } '2' { putchar ('2'); } '3' { putchar ('3'); } '4' { putchar ('4'); } '5' { putchar ('5'); } '6' { putchar ('6'); } '7' { putchar ('7'); } '8' { putchar ('8'); } '9' { putchar ('9'); } { putchar ('\n'); } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "123456789"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:59: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:59" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:59: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:59" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:59: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:59" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:59: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:59" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:59: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -v -o input.c input.y" at_fn_check_prepare_trace "actions.at:59" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:60" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:60" { set +x $as_echo "$at_srcdir/actions.at:60: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:60" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:60" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:63: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:63" ( $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:63" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:63: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:63" ( $at_check_trace; 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: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_275 #AT_START_276 at_fn_group_banner 276 'actions.at:72' \ "Typed midrule actions" " " 12 at_xfail=no ( $as_echo "276. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %debug %code { #include static void yyerror (const char *msg); static int yylex (void); } %union { int ival; } %type exp %% exp: { $$ = 0; } '1' { $$ = 1; } '2' { $$ = 2; } '3' { $$ = 3; } '4' { $$ = 4; } '5' { $$ = 5; } '6' { $$ = 6; } '7' { $$ = 7; } '8' { $$ = 8; } '9' { $$ = 9; } { $$ = 10; } { $$ = 11; } { $$ = $1 + $3 + $5 + $7 + $9 + $11 + $13 + $15 + $17 + $19 + $20 + $21; printf ("%d\n", $$); } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:109: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:109" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:109" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:109: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:109" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:109" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:109: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:109" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:109" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:109: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:109" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:109" $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:109: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -v -o input.c input.y" at_fn_check_prepare_trace "actions.at:109" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:109" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:110" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:110" { set +x $as_echo "$at_srcdir/actions.at:110: \$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:110" ( $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:110" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:113: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:113" ( $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 "66 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:113" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:113: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:113" ( $at_check_trace; 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:113" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:122' \ "Implicitly empty rule" " " 12 at_xfail=no ( $as_echo "277. $at_setup_line: testing $at_desc ..." $at_traceon cat >1.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% exp: a b; a: /* empty. */ {}; // A midrule action does not count as an empty rule. b: {} {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:139: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -Wempty-rule 1.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:139" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -Wempty-rule 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:139: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y" "actions.at:139" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at: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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/actions.at:139: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y" at_fn_check_prepare_trace "actions.at:139" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "1.y:11.17-18: warning: empty rule without %empty [-Wempty-rule] 11 | a: /* empty. */ {}; | ^~ | %empty 1.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $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:139: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Werror" "actions.at:139" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' 1.y:11.17-18: warning: empty rule without %empty [-Wempty-rule] 11 | a: /* empty. */ {}; | ^~ | %empty 1.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:139: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:139" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:139: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=error" "actions.at:139" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:139" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:139: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Wnone,none -Werror --trace=none" "actions.at:139" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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; } { set +x $as_echo "$at_srcdir/actions.at:139: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror --trace=none" "actions.at:139" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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; } at_restore_special_files fi cat >2.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% exp: a b c; a: /* empty. */ {}; b: %empty {}; c: /* empty. */ {}; _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret 2.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:159" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret 2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret 2.y" "actions.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:159" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:159: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:159" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:159" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:159: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:159" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:159" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:159: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret 2.y" at_fn_check_prepare_trace "actions.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "2.y:11.17-18: warning: empty rule without %empty [-Wempty-rule] 11 | a: /* empty. */ {}; | ^~ | %empty 2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule] 13 | c: /* empty. */ {}; | ^~ | %empty 2.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:159" $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:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Werror" "actions.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:159" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' 2.y:11.17-18: warning: empty rule without %empty [-Wempty-rule] 11 | a: /* empty. */ {}; | ^~ | %empty 2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule] 13 | c: /* empty. */ {}; | ^~ | %empty 2.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:159: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:159" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:159" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=error" "actions.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:159" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Wnone,none -Werror --trace=none" "actions.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:159" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:159: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=none -Werror --trace=none" "actions.at:159" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:159" $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:161: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -Wno-empty-rule 2.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:161" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -Wno-empty-rule 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:161: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y" "actions.at:161" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at: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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/actions.at:161: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wno-empty-rule 2.y" at_fn_check_prepare_trace "actions.at:161" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -Wno-empty-rule 2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at: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_277 #AT_START_278 at_fn_group_banner 278 'actions.at:172' \ "Invalid uses of %empty" " " 12 at_xfail=no ( $as_echo "278. $at_setup_line: testing $at_desc ..." $at_traceon cat >one.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% exp: %empty {} %empty ; _ATEOF { set +x $as_echo "$at_srcdir/actions.at:190: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret one.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret one.y" "actions.at:190" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret one.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "one.y:11.13-18: error: only one %empty allowed per rule 11 | %empty {} %empty | ^~~~~~ one.y:11.3-8: previous declaration 11 | %empty {} %empty | ^~~~~~ one.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:190" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:200: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -u one.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -u one.y" "actions.at:200" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -u one.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "one.y:11.13-18: error: only one %empty allowed per rule 11 | %empty {} %empty | ^~~~~~ one.y:11.3-8: previous declaration 11 | %empty {} %empty | ^~~~~~ bison: file 'one.y' was updated (backup: 'one.y~') " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:200" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:207: sed -e '1,8d' one.y" at_fn_check_prepare_trace "actions.at:207" ( $at_check_trace; sed -e '1,8d' one.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "%% exp: %empty {} ; " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:207" $at_failed && at_fn_log_failure $at_traceon; } cat >two.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %% exp: 'a' %empty {} | %empty 'a' {} | %empty {} {} ; _ATEOF { set +x $as_echo "$at_srcdir/actions.at:230: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret two.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret two.y" "actions.at:230" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret two.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "two.y:11.7-12: error: %empty on non-empty rule 11 | 'a' %empty {} | ^~~~~~ two.y:12.3-8: error: %empty on non-empty rule 12 | | %empty 'a' {} | ^~~~~~ two.y:13.3-8: error: %empty on non-empty rule 13 | | %empty {} {} | ^~~~~~ two.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at: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_278 #AT_START_279 at_fn_group_banner 279 'actions.at:240' \ "Valid uses of %empty" " " 12 at_xfail=no ( $as_echo "279. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { #include static void yyerror (const char *msg); static int yylex (void); } %% exp: %empty {} %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:259: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:259: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:259: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:259" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:259" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:259: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:259" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:259" $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:259: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:259" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:259" { set +x $as_echo "$at_srcdir/actions.at:259: \$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:259" ( $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:259" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:260: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:260" ( $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:260" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:260: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:260" ( $at_check_trace; 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: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_279 #AT_START_280 at_fn_group_banner 280 'actions.at:270' \ "Add missing %empty" " " 12 at_xfail=no ( $as_echo "280. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %% exp: a b c d e a: {} b:{ }; c: d : e: %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:285: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --update -Wall input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:285" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --update -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/actions.at:285" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:285: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update -Wall input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update -Wall input.y" "actions.at:285" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update -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/actions.at:285" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:285: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:285" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:285" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:285: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:285" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:285" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:285: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --update -Wall input.y" at_fn_check_prepare_trace "actions.at:285" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --update -Wall 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/actions.at:285" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:297: cat input.y" at_fn_check_prepare_trace "actions.at:297" ( $at_check_trace; cat input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "%% exp: a b c d e a: %empty {} b: %empty { }; c: %empty d : %empty e: %empty %% " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:297" $at_failed && at_fn_log_failure $at_traceon; } # No warnings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:300: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:300" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/actions.at:300" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:300: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" "actions.at:300" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:300" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:300: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:300" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:300" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:300: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:300" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:300: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall input.y" at_fn_check_prepare_trace "actions.at:300" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:300" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:365' \ "Initial location: yacc.c " " " 12 at_xfail=no ( $as_echo "281. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "yacc.c" %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:365: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:365" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:365: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:365" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:365: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:365" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:365" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:365: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:365" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:365" $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:365: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:365" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:365" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:365" { set +x $as_echo "$at_srcdir/actions.at:365: \$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:365" ( $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:365" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:365: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:365" ( $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:365" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:365: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:365" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:365" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:366' \ "Initial location: yacc.c api.pure=full" " " 12 at_xfail=no ( $as_echo "282. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "yacc.c" %define api.pure full %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:366" $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:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:366" { set +x $as_echo "$at_srcdir/actions.at:366: \$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:366" ( $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:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:366: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:366" ( $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:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:366" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:367' \ "Initial location: yacc.c api.pure %parse-param { int x }" "" 12 at_xfail=no ( $as_echo "283. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "yacc.c" %define api.pure %parse-param { int x } %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, int x, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, int x, const char *msg) { YYUSE(x); LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (0); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:367: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:367: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:367" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:367" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:367: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:367" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:367: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:367" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:367" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:367" { set +x $as_echo "$at_srcdir/actions.at:367: \$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:367" ( $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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:367: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:367" ( $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:367" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:367" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:367" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:368' \ "Initial location: yacc.c api.push-pull=both" " " 12 at_xfail=no ( $as_echo "284. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "yacc.c" %define api.push-pull both %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:368: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:368" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:368: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:368" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:368: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:368" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:368" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:368: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:368" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:368" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:368: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:368" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:368" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:368" { set +x $as_echo "$at_srcdir/actions.at:368: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:368" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:368: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:368" ( $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:368" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:368" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "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:368" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:369' \ "Initial location: yacc.c api.push-pull=both api.pure=full" "" 12 at_xfail=no ( $as_echo "285. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "yacc.c" %define api.push-pull both %define api.pure full %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:369: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:369" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:369: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:369" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:369: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:369" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:369" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:369: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:369" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:369: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:369" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:369" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:369" { set +x $as_echo "$at_srcdir/actions.at:369: \$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:369" ( $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:369" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:369: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:369" ( $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:369" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:369" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: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_285 #AT_START_286 at_fn_group_banner 286 'actions.at:370' \ "Initial location: glr.c " " " 12 at_xfail=no ( $as_echo "286. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "glr.c" %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:370: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:370" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:370: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:370" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:370: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:370" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:370" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:370: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:370" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:370" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:370: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:370" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:370" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:370" { set +x $as_echo "$at_srcdir/actions.at:370: \$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:370" ( $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:370" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:370: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:370" ( $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:370" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:370" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "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:370" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_286 #AT_START_287 at_fn_group_banner 287 'actions.at:371' \ "Initial location: glr.c api.pure" " " 12 at_xfail=no ( $as_echo "287. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "glr.c" %define api.pure %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:371: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:371" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:371: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:371" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:371: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:371" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:371" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:371: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:371" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:371" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:371: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:371" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:371" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:371" { set +x $as_echo "$at_srcdir/actions.at:371: \$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:371" ( $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:371" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:371: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:371" ( $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:371" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:371" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "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: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_287 #AT_START_288 at_fn_group_banner 288 'actions.at:372' \ "Initial location: lalr1.cc " " " 12 at_xfail=no ( $as_echo "288. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 << @$ << '\n'; } %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } 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:372: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:372: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:372: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:372" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:372" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:372: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:372" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:372: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:372" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:372" { set +x $as_echo "$at_srcdir/actions.at:372: \$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:372" ( $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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:372: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:372" ( $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:372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:372" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "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:372" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_288 #AT_START_289 at_fn_group_banner 289 'actions.at:373' \ "Initial location: glr.cc " " " 12 at_xfail=no ( $as_echo "289. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 << @$ << '\n'; } %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } 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:373: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:373" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:373" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:373: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:373" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:373: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:373" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:373" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:373: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:373" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:373" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:373: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:373" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:373" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:373" { set +x $as_echo "$at_srcdir/actions.at:373: \$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:373" ( $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:373" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:373: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:373" ( $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:373" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:373: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:373" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "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:373" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_289 #AT_START_290 at_fn_group_banner 290 'actions.at:391' \ "Initial location: yacc.c api.pure=full" " " 12 at_xfail=no ( $as_echo "290. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "yacc.c" %define api.pure full %{ # define YYLTYPE int # define LOCATION_PRINT(Stream, Loc) \ (void) (Loc) # define YYLLOC_DEFAULT(Current, Rhs, N) \ (Current) = ((Rhs)[N ? 1 : 0]) %} %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:391: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:391" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:391" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:391: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:391" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:391" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:391: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:391" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:391" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:391: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:391" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:391" $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:391: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:391" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:391" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:391" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:391" { set +x $as_echo "$at_srcdir/actions.at:391: \$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:391" ( $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:391" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:391: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:391" ( $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:391" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:391" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:391" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:402' \ "Initial location: yacc.c api.pure=full" " " 12 at_xfail=no ( $as_echo "291. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "yacc.c" %define api.pure full %{ # define YYLTYPE int # define LOCATION_PRINT(Stream, Loc) \ fprintf ((Stream), "%d", (Loc)) # define YYLLOC_DEFAULT(Current, Rhs, N) \ (Current) = ((Rhs)[N ? 1 : 0]) %} %code { # include # include /* getenv */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %% exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); } %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { YYUSE(lvalp); YYUSE(llocp); return 'x'; } int main (void) { yydebug = !!getenv ("YYDEBUG"); return !!yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:402: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:402" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:402: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:402" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:402" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:402: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:402" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:402" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:402: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:402" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:402: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:402" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:402" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:402" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:402" { set +x $as_echo "$at_srcdir/actions.at:402: \$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:402" ( $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:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:402: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:402" ( $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:402" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.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 "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:402" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:477' \ "Location print: yacc.c " " " 12 at_xfail=no ( $as_echo "292. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "yacc.c" %code { #include /* putchar. */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %% exp: %empty; %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { YYLTYPE loc; #define TEST(L1, C1, L2, C2) \ loc.first_line = L1; \ loc.first_column = C1; \ loc.last_line = L2; \ loc.last_column = C2; \ LOCATION_PRINT(stdout, loc);\ putchar ('\n'); TEST(1, 1, 1, 1); TEST(2, 1, 2, 10); TEST(3, 1, 4, 1); TEST(5, 1, 6, 10); TEST(7, 2, 0, 2); TEST(8, 0, 8, 0); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:477" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:477" $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:477: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:477" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:477" { set +x $as_echo "$at_srcdir/actions.at:477: \$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:477" ( $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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:477" ( $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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:477" ( $at_check_trace; 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:477" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:477' \ "Location print: glr.c " " " 12 at_xfail=no ( $as_echo "293. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "glr.c" %code { #include /* putchar. */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %% exp: %empty; %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } int main (void) { YYLTYPE loc; #define TEST(L1, C1, L2, C2) \ loc.first_line = L1; \ loc.first_column = C1; \ loc.last_line = L2; \ loc.last_column = C2; \ LOCATION_PRINT(stdout, loc);\ putchar ('\n'); TEST(1, 1, 1, 1); TEST(2, 1, 2, 10); TEST(3, 1, 4, 1); TEST(5, 1, 6, 10); TEST(7, 2, 0, 2); TEST(8, 0, 8, 0); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:477" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:477" $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:477: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:477" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:477" { set +x $as_echo "$at_srcdir/actions.at:477: \$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:477" ( $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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:477" ( $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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:477" ( $at_check_trace; 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:477" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:477' \ "Location print: lalr1.cc " " " 12 at_xfail=no ( $as_echo "294. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "lalr1.cc" %code { #include /* putchar. */ static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %% exp: %empty; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = ""; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; (*llocp).begin.line = (*llocp).end.line = 1; (*llocp).begin.column = (*llocp).end.column = toknum; return res; } int main (void) { yy::parser::location_type loc; #define TEST(L1, C1, L2, C2) \ loc.begin.line = L1; \ loc.begin.column = C1; \ loc.end.line = L2; \ loc.end.column = C2; \ std::cout << loc;\ putchar ('\n'); TEST(1, 1, 1, 1); TEST(2, 1, 2, 10); TEST(3, 1, 4, 1); TEST(5, 1, 6, 10); TEST(7, 2, 0, 2); TEST(8, 0, 8, 0); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:477" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:477" $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:477: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:477" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:477" { set +x $as_echo "$at_srcdir/actions.at:477: \$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:477" ( $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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:477" ( $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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:477" ( $at_check_trace; 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:477" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:477' \ "Location print: glr.cc " " " 12 at_xfail=no ( $as_echo "295. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %debug %skeleton "glr.cc" %code { #include /* putchar. */ static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %% exp: %empty; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = ""; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; (*llocp).begin.line = (*llocp).end.line = 1; (*llocp).begin.column = (*llocp).end.column = toknum; return res; } int main (void) { yy::parser::location_type loc; loc.initialize(); #define TEST(L1, C1, L2, C2) \ loc.begin.line = L1; \ loc.begin.column = C1; \ loc.end.line = L2; \ loc.end.column = C2; \ std::cout << loc;\ putchar ('\n'); TEST(1, 1, 1, 1); TEST(2, 1, 2, 10); TEST(3, 1, 4, 1); TEST(5, 1, 6, 10); TEST(7, 2, 0, 2); TEST(8, 0, 8, 0); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:477" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:477" $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:477: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:477" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:477" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:477" { set +x $as_echo "$at_srcdir/actions.at:477: \$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:477" ( $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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:477" ( $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:477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:477: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:477" ( $at_check_trace; 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:477" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:487' \ "Exotic Dollars" " " 12 at_xfail=no ( $as_echo "296. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %debug %code { #include 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; } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:531: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -d -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:531" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:531: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:531" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:531: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:531" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:531" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:531: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:531" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:531: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -v -o input.c input.y" at_fn_check_prepare_trace "actions.at:531" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -d -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:531" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:532" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:532" { set +x $as_echo "$at_srcdir/actions.at:532: \$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:532" ( $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:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:535: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:535" ( $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:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:535: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:535" ( $at_check_trace; 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:535" $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #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); } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:561: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:561" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:561" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:561: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:561" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:561" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:561: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:561" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:561" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:561: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:561" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:561" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:561: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:561" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:561" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:561" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:561" { set +x $as_echo "$at_srcdir/actions.at:561: \$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:561" ( $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:561" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:564: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:564" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "6 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:564" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:564: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:564" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:564" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_296 #AT_START_297 at_fn_group_banner 297 'actions.at:1047' \ "Printers and Destructors" " " 12 at_xfail=no ( $as_echo "297. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).first_line, (Location).last_line #define USE(SYM) /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } %define parse.error verbose %debug %verbose %locations %code { static int yylex (void); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); } /* FIXME: This %printer isn't actually tested. */ %printer { fprintf (yyo, "%d", $$); } '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END %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 nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); } raise %destructor { fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); } check-spontaneous-errors %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: %empty { $$ = 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"); } | '!' check-spontaneous-errors { $$ = $2; } ; check-spontaneous-errors: raise { abort(); USE(($$, $1)); } | '(' raise ')' { abort(); USE(($$, $2)); } | error { $$ = 5; V(check-spontaneous-errors, $$, @$, ": "); fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); } ; raise: %empty { $$ = 4; V(raise, $$, @$, ": %empty\n"); YYERROR; } | '!' '!' { $$ = 5; V(raise, $$, @$, ": "); V(!, $1, @2, " "); V(!, $2, @2, "\n"); YYERROR; } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULLPTR; # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int counter = 0; int c = (yylval) = counter++; assert (c <= YY_CAST (int, strlen (source))); /* 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; if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); return source[c]; } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); (void) argc; source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1047: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1047" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1047: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1047" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1047: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1047" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1047" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1047: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1047" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1047" $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:1047: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1047" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1047" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1047" { set +x $as_echo "$at_srcdir/actions.at:1047: \$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:1047" ( $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:1047" $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:1047: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1047" ( $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:1047" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1047" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1047" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of empty reductions raising an error # ------------------------------------------------------- # Here, the error is after token "!@0-9", so the error is raised from # @9-9, and the error recovery detects that it starts from @9-9 and # ends where starts the next token: END@10-19. # # So error recovery reports error@9-19. { set +x $as_echo "$at_srcdir/actions.at:1047: \$PREPARSER ./input '!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1047" ( $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:1047" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1047" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: END (1@10-19) raise (4@9-9): %empty check-spontaneous-errors (5@9-19): error (@9-19) Freeing token END (1@10-19) Freeing nterm input (5@0-19) 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:1047" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of not empty reductions raising an error # ----------------------------------------------------------- # This time the error is raised from a rule with 2 rhs symbols: @10-29. # It is recovered @10-29. { set +x $as_echo "$at_srcdir/actions.at:1047: \$PREPARSER ./input '!!!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1047" ( $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:1047" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1047" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: '!' (1@10-19) sending: '!' (2@20-29) raise (5@10-29): ! (1@20-29) ! (2@20-29) check-spontaneous-errors (5@10-29): error (@10-29) sending: END (3@30-39) Freeing token END (3@30-39) Freeing nterm input (5@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:1047" $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:1047: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1047" ( $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:1047" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1047" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1047" $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:1047: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1047" ( $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:1047" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1047" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1047" $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:1047: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1047" ( $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:1047" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1047" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1047" $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:1047: \$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:1047" ( $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:1047" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1047" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: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_297 #AT_START_298 at_fn_group_banner 298 'actions.at:1048' \ "Printers and Destructors with union" " " 12 at_xfail=no ( $as_echo "298. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).first_line, (Location).last_line #define USE(SYM) /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } %define parse.error verbose %debug %verbose %locations %union { int ival; } %code provides { static int yylex (void); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); } %type '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END /* FIXME: This %printer isn't actually tested. */ %printer { fprintf (yyo, "%d", $$); } '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END %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 nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); } raise %destructor { fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); } check-spontaneous-errors %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: %empty { $$ = 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"); } | '!' check-spontaneous-errors { $$ = $2; } ; check-spontaneous-errors: raise { abort(); USE(($$, $1)); } | '(' raise ')' { abort(); USE(($$, $2)); } | error { $$ = 5; V(check-spontaneous-errors, $$, @$, ": "); fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); } ; raise: %empty { $$ = 4; V(raise, $$, @$, ": %empty\n"); YYERROR; } | '!' '!' { $$ = 5; V(raise, $$, @$, ": "); V(!, $1, @2, " "); V(!, $2, @2, "\n"); YYERROR; } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULLPTR; # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int counter = 0; int c = (yylval).ival = counter++; assert (c <= YY_CAST (int, strlen (source))); /* 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; if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); return source[c]; } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); (void) argc; source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1048: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1048" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1048: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1048" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1048: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1048" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1048" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1048: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1048" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:1048: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1048" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1048" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1048" { set +x $as_echo "$at_srcdir/actions.at:1048: \$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:1048" ( $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:1048" $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:1048: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1048" ( $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:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1048" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1048" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of empty reductions raising an error # ------------------------------------------------------- # Here, the error is after token "!@0-9", so the error is raised from # @9-9, and the error recovery detects that it starts from @9-9 and # ends where starts the next token: END@10-19. # # So error recovery reports error@9-19. { set +x $as_echo "$at_srcdir/actions.at:1048: \$PREPARSER ./input '!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1048" ( $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:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1048" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: END (1@10-19) raise (4@9-9): %empty check-spontaneous-errors (5@9-19): error (@9-19) Freeing token END (1@10-19) Freeing nterm input (5@0-19) 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:1048" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of not empty reductions raising an error # ----------------------------------------------------------- # This time the error is raised from a rule with 2 rhs symbols: @10-29. # It is recovered @10-29. { set +x $as_echo "$at_srcdir/actions.at:1048: \$PREPARSER ./input '!!!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1048" ( $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:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1048" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: '!' (1@10-19) sending: '!' (2@20-29) raise (5@10-29): ! (1@20-29) ! (2@20-29) check-spontaneous-errors (5@10-29): error (@10-29) sending: END (3@30-39) Freeing token END (3@30-39) Freeing nterm input (5@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:1048" $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:1048: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1048" ( $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:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1048" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1048" $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:1048: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1048" ( $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:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1048" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1048" $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:1048: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1048" ( $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:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1048" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1048" $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:1048: \$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:1048" ( $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:1048" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1048" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1048" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1050' \ "Printers and Destructors: %glr-parser" " " 12 at_xfail=no ( $as_echo "299. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).first_line, (Location).last_line #define USE(SYM) /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } %define parse.error verbose %debug %verbose %locations %glr-parser %code { static int yylex (void); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); } /* FIXME: This %printer isn't actually tested. */ %printer { fprintf (yyo, "%d", $$); } '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END %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 nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); } raise %destructor { fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); } check-spontaneous-errors %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: %empty { $$ = 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"); } | '!' check-spontaneous-errors { $$ = $2; } ; check-spontaneous-errors: raise { abort(); USE(($$, $1)); } | '(' raise ')' { abort(); USE(($$, $2)); } | error { $$ = 5; V(check-spontaneous-errors, $$, @$, ": "); fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); } ; raise: %empty { $$ = 4; V(raise, $$, @$, ": %empty\n"); YYERROR; } | '!' '!' { $$ = 5; V(raise, $$, @$, ": "); V(!, $1, @2, " "); V(!, $2, @2, "\n"); YYERROR; } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULLPTR; # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int counter = 0; int c = (yylval) = counter++; assert (c <= YY_CAST (int, strlen (source))); /* 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; if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); return source[c]; } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); (void) argc; source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1050: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1050" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1050: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1050" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1050: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1050" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1050" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1050: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1050" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1050" $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:1050: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1050" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1050" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1050" { set +x $as_echo "$at_srcdir/actions.at:1050: \$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:1050" ( $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:1050" $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:1050: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1050" ( $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:1050" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1050" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1050" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of empty reductions raising an error # ------------------------------------------------------- # Here, the error is after token "!@0-9", so the error is raised from # @9-9, and the error recovery detects that it starts from @9-9 and # ends where starts the next token: END@10-19. # # So error recovery reports error@9-19. { set +x $as_echo "$at_srcdir/actions.at:1050: \$PREPARSER ./input '!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1050" ( $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:1050" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1050" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: END (1@10-19) raise (4@9-9): %empty check-spontaneous-errors (5@9-19): error (@9-19) Freeing token END (1@10-19) Freeing nterm input (5@0-19) 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:1050" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of not empty reductions raising an error # ----------------------------------------------------------- # This time the error is raised from a rule with 2 rhs symbols: @10-29. # It is recovered @10-29. { set +x $as_echo "$at_srcdir/actions.at:1050: \$PREPARSER ./input '!!!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1050" ( $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:1050" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1050" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: '!' (1@10-19) sending: '!' (2@20-29) raise (5@10-29): ! (1@20-29) ! (2@20-29) check-spontaneous-errors (5@10-29): error (@10-29) sending: END (3@30-39) Freeing token END (3@30-39) Freeing nterm input (5@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:1050" $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:1050: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1050" ( $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:1050" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1050" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1050" $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:1050: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1050" ( $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:1050" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1050" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1050" $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:1050: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1050" ( $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:1050" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1050" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1050" $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_299 #AT_START_300 at_fn_group_banner 300 'actions.at:1051' \ "Printers and Destructors with union: %glr-parser" "" 12 at_xfail=no ( $as_echo "300. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).first_line, (Location).last_line #define USE(SYM) /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } %define parse.error verbose %debug %verbose %locations %glr-parser %union { int ival; } %code provides { static int yylex (void); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); } %type '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END /* FIXME: This %printer isn't actually tested. */ %printer { fprintf (yyo, "%d", $$); } '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END %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 nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); } raise %destructor { fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); } check-spontaneous-errors %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: %empty { $$ = 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"); } | '!' check-spontaneous-errors { $$ = $2; } ; check-spontaneous-errors: raise { abort(); USE(($$, $1)); } | '(' raise ')' { abort(); USE(($$, $2)); } | error { $$ = 5; V(check-spontaneous-errors, $$, @$, ": "); fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); } ; raise: %empty { $$ = 4; V(raise, $$, @$, ": %empty\n"); YYERROR; } | '!' '!' { $$ = 5; V(raise, $$, @$, ": "); V(!, $1, @2, " "); V(!, $2, @2, "\n"); YYERROR; } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULLPTR; # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int counter = 0; int c = (yylval).ival = counter++; assert (c <= YY_CAST (int, strlen (source))); /* 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; if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc))); return source[c]; } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); (void) argc; source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1051: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1051" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1051: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1051" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1051: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1051" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1051" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1051: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1051" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1051" $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:1051: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1051" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1051" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1051" { set +x $as_echo "$at_srcdir/actions.at:1051: \$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:1051" ( $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:1051" $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:1051: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1051" ( $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:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1051" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1051" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of empty reductions raising an error # ------------------------------------------------------- # Here, the error is after token "!@0-9", so the error is raised from # @9-9, and the error recovery detects that it starts from @9-9 and # ends where starts the next token: END@10-19. # # So error recovery reports error@9-19. { set +x $as_echo "$at_srcdir/actions.at:1051: \$PREPARSER ./input '!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1051" ( $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:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1051" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: END (1@10-19) raise (4@9-9): %empty check-spontaneous-errors (5@9-19): error (@9-19) Freeing token END (1@10-19) Freeing nterm input (5@0-19) 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:1051" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of not empty reductions raising an error # ----------------------------------------------------------- # This time the error is raised from a rule with 2 rhs symbols: @10-29. # It is recovered @10-29. { set +x $as_echo "$at_srcdir/actions.at:1051: \$PREPARSER ./input '!!!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1051" ( $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:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1051" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: '!' (1@10-19) sending: '!' (2@20-29) raise (5@10-29): ! (1@20-29) ! (2@20-29) check-spontaneous-errors (5@10-29): error (@10-29) sending: END (3@30-39) Freeing token END (3@30-39) Freeing nterm input (5@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:1051" $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:1051: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1051" ( $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:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1051" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1051" $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:1051: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1051" ( $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:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1051" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1051" $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:1051: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1051" ( $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:1051" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1051" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1051" $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_300 #AT_START_301 at_fn_group_banner 301 'actions.at:1053' \ "Printers and Destructors: %defines lalr1.cc" " " 12 at_xfail=no ( $as_echo "301. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).begin.line, (Location).end.line #define USE(SYM) /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } %define parse.error verbose %debug %verbose %locations %defines %skeleton "lalr1.cc" %define global_tokens_and_yystype %code { typedef yy::location YYLTYPE; static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } /* FIXME: This %printer isn't actually tested. */ %printer { yyo << $$;; } '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END %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 nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); } raise %destructor { fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); } check-spontaneous-errors %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: %empty { $$ = 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"); } | '!' check-spontaneous-errors { $$ = $2; } ; check-spontaneous-errors: raise { abort(); USE(($$, $1)); } | '(' raise ')' { abort(); USE(($$, $2)); } | error { $$ = 5; V(check-spontaneous-errors, $$, @$, ": "); fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); } ; raise: %empty { $$ = 4; V(raise, $$, @$, ": %empty\n"); YYERROR; } | '!' '!' { $$ = 5; V(raise, $$, @$, ": "); V(!, $1, @2, " "); V(!, $2, @2, "\n"); YYERROR; } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULLPTR; /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static int counter = 0; int c = (*lvalp) = counter++; assert (c <= YY_CAST (int, strlen (source))); /* 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; if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp))); return source[c]; } static bool yydebug; int yyparse () { yy::parser parser; parser.set_debug_level (yydebug); return parser.parse (); } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); (void) argc; source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1053: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1053: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1053: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1053" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1053" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1053: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1053" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1053" $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:1053: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:1053" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1053" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1053" { set +x $as_echo "$at_srcdir/actions.at:1053: \$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:1053" ( $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:1053" $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:1053: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1053" ( $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:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.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 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:1053" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of empty reductions raising an error # ------------------------------------------------------- # Here, the error is after token "!@0-9", so the error is raised from # @9-9, and the error recovery detects that it starts from @9-9 and # ends where starts the next token: END@10-19. # # So error recovery reports error@9-19. { set +x $as_echo "$at_srcdir/actions.at:1053: \$PREPARSER ./input '!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1053" ( $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:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.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 echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) sending: END (1@10-19) raise (4@9-9): %empty check-spontaneous-errors (5@9-19): error (@9-19) Freeing token END (1@10-19) Freeing nterm input (5@0-19) 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:1053" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of not empty reductions raising an error # ----------------------------------------------------------- # This time the error is raised from a rule with 2 rhs symbols: @10-29. # It is recovered @10-29. { set +x $as_echo "$at_srcdir/actions.at:1053: \$PREPARSER ./input '!!!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1053" ( $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:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.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 echo >>"$at_stderr"; $as_echo "sending: '!' (0@0-9) sending: '!' (1@10-19) sending: '!' (2@20-29) raise (5@10-29): ! (1@20-29) ! (2@20-29) check-spontaneous-errors (5@10-29): error (@10-29) sending: END (3@30-39) Freeing token END (3@30-39) Freeing nterm input (5@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:1053" $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:1053: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1053" ( $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:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.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 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:1053" $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:1053: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1053" ( $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:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.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 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:1053" $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:1053: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1053" ( $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:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.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 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:1053" $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_301 #AT_START_302 at_fn_group_banner 302 'actions.at:1054' \ "Printers and Destructors with union: %defines lalr1.cc" "" 12 at_xfail=no ( $as_echo "302. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).begin.line, (Location).end.line #define USE(SYM) /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } %define parse.error verbose %debug %verbose %locations %defines %skeleton "lalr1.cc" %union { int ival; } %define global_tokens_and_yystype %code provides { typedef yy::location YYLTYPE; static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %type '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END /* FIXME: This %printer isn't actually tested. */ %printer { yyo << $$;; } '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END %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 nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); } raise %destructor { fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); } check-spontaneous-errors %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: %empty { $$ = 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"); } | '!' check-spontaneous-errors { $$ = $2; } ; check-spontaneous-errors: raise { abort(); USE(($$, $1)); } | '(' raise ')' { abort(); USE(($$, $2)); } | error { $$ = 5; V(check-spontaneous-errors, $$, @$, ": "); fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); } ; raise: %empty { $$ = 4; V(raise, $$, @$, ": %empty\n"); YYERROR; } | '!' '!' { $$ = 5; V(raise, $$, @$, ": "); V(!, $1, @2, " "); V(!, $2, @2, "\n"); YYERROR; } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULLPTR; /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static int counter = 0; int c = (*lvalp).ival = counter++; assert (c <= YY_CAST (int, strlen (source))); /* 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; if (source[c]) fprintf (stderr, "sending: '%c'", source[c]); else fprintf (stderr, "sending: END"); fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp))); return source[c]; } static bool yydebug; int yyparse () { yy::parser parser; parser.set_debug_level (yydebug); return parser.parse (); } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); (void) argc; source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1054: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1054: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1054: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1054" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1054" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1054: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1054" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:1054: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:1054" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1054" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1054" { set +x $as_echo "$at_srcdir/actions.at:1054: \$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:1054" ( $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:1054" $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:1054: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1054" ( $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:1054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1054" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1054" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of empty reductions raising an error # ------------------------------------------------------- # Here, the error is after token "!@0-9", so the error is raised from # @9-9, and the error recovery detects that it starts from @9-9 and # ends where starts the next token: END@10-19. # # So error recovery reports error@9-19. { set +x $as_echo "$at_srcdir/actions.at:1054: \$PREPARSER ./input '!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1054" ( $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:1054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1054" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: END (1@10-19) raise (4@9-9): %empty check-spontaneous-errors (5@9-19): error (@9-19) Freeing token END (1@10-19) Freeing nterm input (5@0-19) 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:1054" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of not empty reductions raising an error # ----------------------------------------------------------- # This time the error is raised from a rule with 2 rhs symbols: @10-29. # It is recovered @10-29. { set +x $as_echo "$at_srcdir/actions.at:1054: \$PREPARSER ./input '!!!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1054" ( $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:1054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1054" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: '!' (1@10-19) sending: '!' (2@20-29) raise (5@10-29): ! (1@20-29) ! (2@20-29) check-spontaneous-errors (5@10-29): error (@10-29) sending: END (3@30-39) Freeing token END (3@30-39) Freeing nterm input (5@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:1054" $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:1054: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1054" ( $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:1054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1054" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1054" $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:1054: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1054" ( $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:1054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1054" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1054" $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:1054: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1054" ( $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:1054" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1054" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1054" $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_302 #AT_START_303 at_fn_group_banner 303 'actions.at:1056' \ "Printers and Destructors: %defines glr.cc" " " 12 at_xfail=no ( $as_echo "303. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).begin.line, (Location).end.line #define USE(SYM) /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } %define parse.error verbose %debug %verbose %locations %defines %skeleton "glr.cc" %code { static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } /* FIXME: This %printer isn't actually tested. */ %printer { yyo << $$;; } '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END %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 nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); } raise %destructor { fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); } check-spontaneous-errors %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: %empty { $$ = 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"); } | '!' check-spontaneous-errors { $$ = $2; } ; check-spontaneous-errors: raise { abort(); USE(($$, $1)); } | '(' raise ')' { abort(); USE(($$, $2)); } | error { $$ = 5; V(check-spontaneous-errors, $$, @$, ": "); fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); } ; raise: %empty { $$ = 4; V(raise, $$, @$, ": %empty\n"); YYERROR; } | '!' '!' { $$ = 5; V(raise, $$, @$, ": "); V(!, $1, @2, " "); V(!, $2, @2, "\n"); YYERROR; } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULLPTR; /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static int counter = 0; int c = (*lvalp) = counter++; assert (c <= YY_CAST (int, strlen (source))); /* 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; 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]; } int yyparse () { yy::parser parser; parser.set_debug_level (yydebug); return parser.parse (); } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); (void) argc; source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1056: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1056" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1056" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1056: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1056" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1056: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1056" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1056" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1056: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1056" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1056" $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:1056: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:1056" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1056" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1056" { set +x $as_echo "$at_srcdir/actions.at:1056: \$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:1056" ( $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:1056" $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:1056: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1056" ( $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:1056" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1056" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1056" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of empty reductions raising an error # ------------------------------------------------------- # Here, the error is after token "!@0-9", so the error is raised from # @9-9, and the error recovery detects that it starts from @9-9 and # ends where starts the next token: END@10-19. # # So error recovery reports error@9-19. { set +x $as_echo "$at_srcdir/actions.at:1056: \$PREPARSER ./input '!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1056" ( $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:1056" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1056" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: END (1@10-19) raise (4@9-9): %empty check-spontaneous-errors (5@9-19): error (@9-19) Freeing token END (1@10-19) Freeing nterm input (5@0-19) 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:1056" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of not empty reductions raising an error # ----------------------------------------------------------- # This time the error is raised from a rule with 2 rhs symbols: @10-29. # It is recovered @10-29. { set +x $as_echo "$at_srcdir/actions.at:1056: \$PREPARSER ./input '!!!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1056" ( $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:1056" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1056" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: '!' (1@10-19) sending: '!' (2@20-29) raise (5@10-29): ! (1@20-29) ! (2@20-29) check-spontaneous-errors (5@10-29): error (@10-29) sending: END (3@30-39) Freeing token END (3@30-39) Freeing nterm input (5@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:1056" $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:1056: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1056" ( $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:1056" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1056" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1056" $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:1056: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1056" ( $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:1056" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1056" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1056" $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:1056: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1056" ( $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:1056" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1056" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1056" $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_303 #AT_START_304 at_fn_group_banner 304 'actions.at:1057' \ "Printers and Destructors with union: %defines glr.cc" "" 12 at_xfail=no ( $as_echo "304. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include #include #include #include #define YYINITDEPTH 10 #define YYMAXDEPTH 10 #define RANGE(Location) (Location).begin.line, (Location).end.line #define USE(SYM) /* Display the symbol type Symbol. */ #define V(Symbol, Value, Location, Sep) \ fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep) } %define parse.error verbose %debug %verbose %locations %defines %skeleton "glr.cc" %union { int ival; } %code provides { static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %type '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END /* FIXME: This %printer isn't actually tested. */ %printer { yyo << $$;; } '(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END %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 nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); } raise %destructor { fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); } check-spontaneous-errors %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: %empty { $$ = 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"); } | '!' check-spontaneous-errors { $$ = $2; } ; check-spontaneous-errors: raise { abort(); USE(($$, $1)); } | '(' raise ')' { abort(); USE(($$, $2)); } | error { $$ = 5; V(check-spontaneous-errors, $$, @$, ": "); fprintf (stderr, "error (@%d-%d)\n", RANGE(@1)); } ; raise: %empty { $$ = 4; V(raise, $$, @$, ": %empty\n"); YYERROR; } | '!' '!' { $$ = 5; V(raise, $$, @$, ": "); V(!, $1, @2, " "); V(!, $2, @2, "\n"); YYERROR; } ; line: thing thing thing ';' { $$ = $1; V(line, $$, @$, ": "); V(thing, $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(;, $4, @4, "\n"); } | '(' thing thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(thing, $3, @3, " "); V(')', $4, @4, "\n"); } | '(' thing ')' { $$ = $1; V(line, $$, @$, ": "); V('(', $1, @1, " "); V(thing, $2, @2, " "); V(')', $3, @3, "\n"); } | '(' error ')' { $$ = -1; V(line, $$, @$, ": "); V('(', $1, @1, " "); fprintf (stderr, "error (@%d-%d) ", RANGE(@2)); V(')', $3, @3, "\n"); } ; thing: 'x' { $$ = $1; V(thing, $$, @$, ": "); V('x', $1, @1, "\n"); } ; %% /* Alias to ARGV[1]. */ const char *source = YY_NULLPTR; /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static int counter = 0; int c = (*lvalp).ival = counter++; assert (c <= YY_CAST (int, strlen (source))); /* 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; 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]; } int yyparse () { yy::parser parser; parser.set_debug_level (yydebug); return parser.parse (); } int main (int argc, const char *argv[]) { int status; yydebug = !!getenv ("YYDEBUG"); assert (argc == 2); (void) argc; source = argv[1]; status = yyparse (); switch (status) { case 0: fprintf (stderr, "Successful parse.\n"); break; case 1: fprintf (stderr, "Parsing FAILED.\n"); break; default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1057: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1057" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1057" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1057: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1057" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1057: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1057" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1057" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1057: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1057" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1057" $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:1057: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:1057" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1057" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1057" { set +x $as_echo "$at_srcdir/actions.at:1057: \$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:1057" ( $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:1057" $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:1057: \$PREPARSER ./input '(x)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1057" ( $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:1057" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1057" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1057" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of empty reductions raising an error # ------------------------------------------------------- # Here, the error is after token "!@0-9", so the error is raised from # @9-9, and the error recovery detects that it starts from @9-9 and # ends where starts the next token: END@10-19. # # So error recovery reports error@9-19. { set +x $as_echo "$at_srcdir/actions.at:1057: \$PREPARSER ./input '!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1057" ( $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:1057" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1057" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: END (1@10-19) raise (4@9-9): %empty check-spontaneous-errors (5@9-19): error (@9-19) Freeing token END (1@10-19) Freeing nterm input (5@0-19) 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:1057" $at_failed && at_fn_log_failure $at_traceon; } # Check the location of not empty reductions raising an error # ----------------------------------------------------------- # This time the error is raised from a rule with 2 rhs symbols: @10-29. # It is recovered @10-29. { set +x $as_echo "$at_srcdir/actions.at:1057: \$PREPARSER ./input '!!!'" at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1057" ( $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:1057" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1057" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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: '!' (1@10-19) sending: '!' (2@20-29) raise (5@10-29): ! (1@20-29) ! (2@20-29) check-spontaneous-errors (5@10-29): error (@10-29) sending: END (3@30-39) Freeing token END (3@30-39) Freeing nterm input (5@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:1057" $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:1057: \$PREPARSER ./input '(y)'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1057" ( $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:1057" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1057" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1057" $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:1057: \$PREPARSER ./input '(xxxxx)(x)(x)y'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1057" ( $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:1057" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1057" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1057" $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:1057: \$PREPARSER ./input '(x)(x)x'" at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1057" ( $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:1057" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1057" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1057" $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_304 #AT_START_305 at_fn_group_banner 305 'actions.at:1068' \ "Default tagless %printer and %destructor" " " 12 at_xfail=no ( $as_echo "305. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %debug %locations %code { static int yylex (void); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); # define USE(SYM) } %printer { #error "<*> printer should not be used." } <*> %printer { fprintf (yyo, "<> printer for '%c' @ %d", $$, @$.first_column); } <> %destructor { printf ("<> destructor for '%c' @ %d.\n", $$, @$.first_column); } <> %printer { fprintf (yyo, "'b'/'c' printer for '%c' @ %d", $$, @$.first_column); } 'b' 'c' %destructor { printf ("'b'/'c' destructor for '%c' @ %d.\n", $$, @$.first_column); } 'b' 'c' %destructor { #error "<*> destructor should not be used." } <*> %% start: 'a' 'b' 'c' 'd' 'e' { $$ = 'S'; USE(($1, $2, $3, $4, $5)); } ; %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "abcd"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; yylval = res; (yylloc).first_line = (yylloc).last_line = 1; (yylloc).first_column = (yylloc).last_column = toknum; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1116: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1116" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1116" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1116: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1116" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1116" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1116: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1116" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1116" $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:1116: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1116" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:30.3-5: warning: useless %destructor for type <*> [-Wother] input.y:30.3-5: warning: useless %printer for type <*> [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116" $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:1116: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1116" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1116" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:30.3-5: warning: useless %destructor for type <*> [-Wother] input.y:30.3-5: warning: useless %printer for type <*> [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:1116: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1116" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1116" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1116" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1116" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1116" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1116" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1116" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "actions.at:1117" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1117" { set +x $as_echo "$at_srcdir/actions.at:1117: \$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:1117" ( $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:1117" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1150: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1150" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "<> destructor for 'd' @ 4. 'b'/'c' destructor for 'c' @ 3. 'b'/'c' destructor for 'b' @ 2. <> destructor for 'a' @ 1. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at: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' (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: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_305 #AT_START_306 at_fn_group_banner 306 'actions.at:1161' \ "Default tagged and per-type %printer and %destructor" "" 12 at_xfail=no ( $as_echo "306. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %debug %{ #include static void yyerror (const char *msg); static int yylex (void); # define USE(SYM) %} %printer { #error "<> printer should not be used." } <> %union { int field0; int field1; int field2; } %type start 'a' 'g' %type 'e' %type 'f' %printer { fprintf (yyo, "<*>//e printer"); } <*> 'e' %destructor { printf ("<*>//e destructor.\n"); } <*> 'e' %type 'b' %printer { fprintf (yyo, " printer"); } %destructor { printf (" destructor.\n"); } %type 'c' %printer { fprintf (yyo, "'c' printer"); } 'c' %destructor { printf ("'c' destructor.\n"); } 'c' %type 'd' %printer { fprintf (yyo, "'d' printer"); } 'd' %destructor { printf ("'d' destructor.\n"); } 'd' %destructor { #error "<> destructor should not be used." } <> %% start: 'a' 'b' 'c' 'd' 'e' 'f' 'g' { USE(($1, $2, $3, $4, $5, $6, $7)); $$ = 'S'; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "abcdef"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1223: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1223" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1223" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1223: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1223" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1223" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1223: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1223" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1223" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1223: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1223" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1223" $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:1223: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1223" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:22.3-4: warning: useless %destructor for type <> [-Wother] input.y:22.3-4: warning: useless %printer for type <> [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1223" $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:1223: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1223" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1223" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:22.3-4: warning: useless %destructor for type <> [-Wother] input.y:22.3-4: warning: useless %printer for type <> [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:1223: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1223" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1223" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1223: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1223" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1223" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:1223: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1223" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1223" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1223: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1223" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1223" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "actions.at:1224" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1224" { set +x $as_echo "$at_srcdir/actions.at:1224: \$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:1224" ( $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:1224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1269: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1269" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "<*>//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:1269" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1269: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1269" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1269" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1280' \ "Default %printer and %destructor for user-defined end token" "" 12 at_xfail=no ( $as_echo "307. $at_setup_line: testing $at_desc ..." $at_traceon # AT_TEST(TYPED) # -------------- cat >input0.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %debug %locations %code { #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); # define USE(SYM) } %destructor { #error "<*> destructor should not be used." } <*> %token END 0 %printer { fprintf (yyo, "<> for '%c' @ %d", $$, @$.first_column); } <> %destructor { printf ("<> for '%c' @ %d.\n", $$, @$.first_column); } <> %printer { #error "<*> printer should not be used." } <*> %% start: { $$ = 'S'; } ; %% #include /* abort */ static int yylex (void) { static int called; if (called++) abort (); yylval = 'E'; yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 1; return 0; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1377: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input0.c input0.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1377" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1377: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y" "actions.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1377" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1377: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1377" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1377" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1377: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1377" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1377" $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:1377: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input0.c input0.y" at_fn_check_prepare_trace "actions.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input0.c input0.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input0.y:30.3-5: warning: useless %destructor for type <*> [-Wother] input0.y:30.3-5: warning: useless %printer for type <*> [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1377" $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:1377: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Werror" "actions.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1377" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input0.y:30.3-5: warning: useless %destructor for type <*> [-Wother] input0.y:30.3-5: warning: useless %printer for type <*> [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:1377: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1377" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1377" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1377: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=error" "actions.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1377" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:1377: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Wnone,none -Werror --trace=none" "actions.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1377" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1377: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=none -Werror --trace=none" "actions.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1377" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "actions.at:1377" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1377" { set +x $as_echo "$at_srcdir/actions.at:1377: \$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:1377" ( $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:1377" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1377: \$PREPARSER ./input0 --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input0 --debug" "actions.at:1377" ( $at_check_trace; $PREPARSER ./input0 --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "<> for 'E' @ 1. <> for 'S' @ 1. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1377" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1377: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1377" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reducing stack by rule 1 (line 49): -> \$\$ = nterm start (1.1: <> for 'S' @ 1) Stack now 0 Entering state 1 Reading a token: Now at end of input. Shifting token END (1.1: <> for 'E' @ 1) Entering state 2 Stack now 0 1 2 Cleanup: popping token END (1.1: <> for 'E' @ 1) Cleanup: popping nterm start (1.1: <> for 'S' @ 1) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1377" $at_failed && at_fn_log_failure $at_traceon; } cat >input1.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %debug %locations %code { #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); # define USE(SYM) } %destructor { #error "<> destructor should not be used." } <> %token END 0 %printer { fprintf (yyo, "<*> for '%c' @ %d", $$, @$.first_column); } <*> %destructor { printf ("<*> for '%c' @ %d.\n", $$, @$.first_column); } <*> %printer { #error "<> printer should not be used." } <> %union { char tag; } %type start END %% start: { $$ = 'S'; } ; %% #include /* abort */ static int yylex (void) { static int called; if (called++) abort (); yylval.tag = 'E'; yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 1; return 0; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1378: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input1.c input1.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1378" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1378" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1378: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y" "actions.at:1378" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1378" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1378: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1378" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1378" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1378: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1378" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/actions.at:1378: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input1.c input1.y" at_fn_check_prepare_trace "actions.at:1378" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input1.c input1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input1.y:30.3-4: warning: useless %destructor for type <> [-Wother] input1.y:30.3-4: warning: useless %printer for type <> [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1378" $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:1378: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Werror" "actions.at:1378" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1378" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input1.y:30.3-4: warning: useless %destructor for type <> [-Wother] input1.y:30.3-4: warning: useless %printer for type <> [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:1378: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1378" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1378" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1378: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=error" "actions.at:1378" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1378" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:1378: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Wnone,none -Werror --trace=none" "actions.at:1378" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1378" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1378: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=none -Werror --trace=none" "actions.at:1378" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1378" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "actions.at:1378" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1378" { set +x $as_echo "$at_srcdir/actions.at:1378: \$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:1378" ( $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:1378" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1378: \$PREPARSER ./input1 --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input1 --debug" "actions.at:1378" ( $at_check_trace; $PREPARSER ./input1 --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "<*> for 'E' @ 1. <*> for 'S' @ 1. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1378" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1378: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1378" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reducing stack by rule 1 (line 49): -> \$\$ = nterm start (1.1: <*> for 'S' @ 1) Stack now 0 Entering state 1 Reading a token: Now at end of input. Shifting token END (1.1: <*> for 'E' @ 1) Entering state 2 Stack now 0 1 2 Cleanup: popping token END (1.1: <*> for 'E' @ 1) Cleanup: popping nterm start (1.1: <*> for 'S' @ 1) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1378" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1390' \ "Default %printer and %destructor are not for error or \$undefined" "" 12 at_xfail=no ( $as_echo "308. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %{ # include # include #include static void yyerror (const char *msg); static int yylex (void); # define USE(SYM) %} %printer { fprintf (yyo, "'%c'", $$); } <> <*> %destructor { fprintf (stderr, "DESTROY '%c'\n", $$); } <> <*> %% start: { $$ = 'S'; } /* In order to reveal the problems that this bug caused during parsing, add * $2 to USE. */ | 'a' error 'b' 'c' { USE(($1, $3, $4)); $$ = 'S'; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "abd"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; yylval = res; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1438" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1438: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1438" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1438" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1438: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1438" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1438" $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:1438: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:23.6-8: warning: useless %destructor for type <*> [-Wother] input.y:23.6-8: warning: useless %printer for type <*> [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1438" $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:1438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1438" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:23.6-8: warning: useless %destructor for type <*> [-Wother] input.y:23.6-8: warning: useless %printer for type <*> [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:1438: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1438" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1438" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1438" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:1438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1438" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "actions.at:1439" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1439" { set +x $as_echo "$at_srcdir/actions.at:1439: \$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:1439" ( $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:1439" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1473: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1473" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1473" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1473: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1473" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1473" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1483' \ "Default %printer and %destructor are not for \$accept" "" 12 at_xfail=no ( $as_echo "309. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug /* So that %printer is actually compiled. */ %{ # include # include #include static void yyerror (const char *msg); static int yylex (void); # define USE(SYM) %} %printer { char chr = $$; fprintf (yyo, "'%c'", chr); } <> <*> %destructor { char chr = $$; fprintf (stderr, "DESTROY '%c'\n", chr); } <> <*> %union { char chr; } %type start %% start: { USE($$); } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1536: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1536" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1536" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1536: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1536" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1536" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1536: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1536" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1536" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1536: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1536" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1536" $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:1536: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1536" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:24.3-4: warning: useless %destructor for type <> [-Wother] input.y:24.3-4: warning: useless %printer for type <> [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1536" $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:1536: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1536" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1536" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:24.3-4: warning: useless %destructor for type <> [-Wother] input.y:24.3-4: warning: useless %printer for type <> [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:1536: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1536" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1536" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1536: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1536" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1536" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:1536: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1536" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1536" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1536: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1536" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1536" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "actions.at:1537" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1537" { set +x $as_echo "$at_srcdir/actions.at:1537: \$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:1537" ( $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:1537" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1547' \ "Default %printer and %destructor for midrule values" "" 12 at_xfail=no ( $as_echo "310. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug /* So that %printer is actually compiled. */ %{ #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 LOCATION_PRINT(File, Loc) %} %printer { fprintf (yyo, "%d", @$); } <> %destructor { fprintf (stderr, "DESTROY %d\n", @$); } <> %printer { #error "<*> printer should not be used" } <*> %destructor { #error "<*> destructor should not be used" } <*> %% start: { @$ = 1; } // Not set or used. { USE ($$); @$ = 2; } // Both set and used. { USE ($$); @$ = 3; } // Only set. { @$ = 4; } // Only used. 'c' { USE (($$, $2, $4, $5)); @$ = 0; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1590: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1590" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1590" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1590: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1590" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1590" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1590: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1590" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1590" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1590: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1590" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1590" $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:1590: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1590" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:24.57-59: warning: useless %destructor for type <*> [-Wother] input.y:24.57-59: warning: useless %printer for type <*> [-Wother] input.y:33.3-23: warning: unset value: \$\$ [-Wother] input.y:32.3-23: warning: unused value: \$3 [-Wother] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1590" $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:1590: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1590" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1590" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:24.57-59: warning: useless %destructor for type <*> [-Wother] input.y:24.57-59: warning: useless %printer for type <*> [-Wother] input.y:33.3-23: warning: unset value: $$ [-Wother] input.y:32.3-23: warning: unused value: $3 [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:1590: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1590" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1590" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1590: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1590" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1590" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:1590: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1590" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1590" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1590: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1590" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1590" $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:1605: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1605" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1605: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "actions.at:1605" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1605" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1605: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1605" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1605" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1605: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1605" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1605" $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:1605: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1605" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:24.57-59: warning: useless %destructor for type <*> [-Wother] 24 | %printer { #error \"<*> printer should not be used\" } <*> | ^~~ input.y:24.57-59: warning: useless %printer for type <*> [-Wother] 24 | %printer { #error \"<*> printer should not be used\" } <*> | ^~~ input.y:33.3-23: warning: unset value: \$\$ [-Wother] 33 | { @\$ = 4; } // Only used. | ^~~~~~~~~~~~~~~~~~~~~ input.y:32.3-23: warning: unused value: \$3 [-Wother] 32 | { 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:1605" $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:1605: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror" "actions.at:1605" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1605" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:24.57-59: warning: useless %destructor for type <*> [-Wother] 24 | %printer { #error "<*> printer should not be used" } <*> | ^~~ input.y:24.57-59: warning: useless %printer for type <*> [-Wother] 24 | %printer { #error "<*> printer should not be used" } <*> | ^~~ input.y:33.3-23: warning: unset value: $$ [-Wother] 33 | { @$ = 4; } // Only used. | ^~~~~~~~~~~~~~~~~~~~~ input.y:32.3-23: warning: unused value: $3 [-Wother] 32 | { USE ($$); @$ = 3; } // Only set. | ^~~~~~~~~~~~~~~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/actions.at:1605: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1605" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1605" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/actions.at:1605: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error" "actions.at:1605" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1605" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/actions.at:1605: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1605" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1605" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1605: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1605" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1605" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "actions.at:1607" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1607" { set +x $as_echo "$at_srcdir/actions.at:1607: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1607" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1607" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1642: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1642" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1642" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1642" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1642" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1692' \ "@\$ in %initial-action implies %locations" " " 12 at_xfail=no ( $as_echo "311. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #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; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1692: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1692" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1692" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1692: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1692" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1692" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1692: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1692" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1692" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1692: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1692" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1692" $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:1692: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1692" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1692" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1692" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1692" { set +x $as_echo "$at_srcdir/actions.at:1692: \$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:1692" ( $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:1692" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1693' \ "@\$ in %destructor implies %locations" " " 12 at_xfail=no ( $as_echo "312. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #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; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1693: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1693" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1693" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1693: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1693" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1693" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1693: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1693" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1693" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1693: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1693" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1693" $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:1693: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1693" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1693" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1693" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1693" { set +x $as_echo "$at_srcdir/actions.at:1693: \$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:1693" ( $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:1693" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_312 #AT_START_313 at_fn_group_banner 313 'actions.at:1694' \ "@\$ in %printer implies %locations" " " 12 at_xfail=no ( $as_echo "313. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #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; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1694" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1694: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1694" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1694: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1694" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1694" $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:1694: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1694" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1694" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1694" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1694" { set +x $as_echo "$at_srcdir/actions.at:1694: \$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:1694" ( $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:1694" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1808' \ "Qualified \$\$ in actions: yacc.c" " " 12 at_xfail=no ( $as_echo "314. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "yacc.c" %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 { #include 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.2f; } %% float: UNTYPED INT { $$ = $1 + $2; $$ = $1 + $2; }; %% /* 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[] = {UNTYPED, INT, EOF}; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; (yylval).ival = toknum * 10; (yylval).fval = YY_CAST (float, toknum) / 10.0f;; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1808: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1808: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1808" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1808" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1808: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1808" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1808" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1808: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1808" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1808" { set +x $as_echo "$at_srcdir/actions.at:1808: \$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:1808" ( $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:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1808" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1808" $at_failed && at_fn_log_failure $at_traceon; } # Don't be too picky on the traces, GLR is not exactly the same. Keep # only the lines from the printer. { set +x $as_echo "$at_srcdir/actions.at:1808: sed -ne '/ival:/p' stderr" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; sed -ne '/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) Shifting token UNTYPED (ival: 10, fval: 0.1) Reading a token: Next token is token INT (ival: 20, fval: 0.2) Shifting token INT (ival: 20, fval: 0.2) \$1 = token UNTYPED (ival: 10, fval: 0.1) \$2 = token INT (ival: 20, fval: 0.2) -> \$\$ = nterm float (ival: 30, fval: 0.3) Cleanup: popping nterm float (ival: 30, fval: 0.3) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1808' \ "Qualified \$\$ in actions: glr.c" " " 12 at_xfail=no ( $as_echo "315. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.c" %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 { #include 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.2f; } %% float: UNTYPED INT { $$ = $1 + $2; $$ = $1 + $2; }; %% /* 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[] = {UNTYPED, INT, EOF}; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; (yylval).ival = toknum * 10; (yylval).fval = YY_CAST (float, toknum) / 10.0f;; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1808: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1808: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1808" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1808" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1808: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1808" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1808" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1808: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1808" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1808" { set +x $as_echo "$at_srcdir/actions.at:1808: \$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:1808" ( $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:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1808" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1808" $at_failed && at_fn_log_failure $at_traceon; } # Don't be too picky on the traces, GLR is not exactly the same. Keep # only the lines from the printer. { set +x $as_echo "$at_srcdir/actions.at:1808: sed -ne '/ival:/p' stderr" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; sed -ne '/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) Shifting token UNTYPED (ival: 10, fval: 0.1) Reading a token: Next token is token INT (ival: 20, fval: 0.2) Shifting token INT (ival: 20, fval: 0.2) \$1 = token UNTYPED (ival: 10, fval: 0.1) \$2 = token INT (ival: 20, fval: 0.2) -> \$\$ = nterm float (ival: 30, fval: 0.3) Cleanup: popping nterm float (ival: 30, fval: 0.3) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1808' \ "Qualified \$\$ in actions: lalr1.cc" " " 12 at_xfail=no ( $as_echo "316. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %debug %code requires { typedef struct sem_type { int ival; float fval; } sem_type; # define YYSTYPE sem_type # include // EOF. # include namespace { void report (std::ostream& yyo, int ival, float fval) { yyo << "ival: " << ival << ", fval: " << fval; } } } %code { static int yylex (yy::parser::semantic_type *lvalp); } %token UNTYPED %token INT %type float %printer { report (yyo, $$, $$); } ; %printer { report (yyo, $$, $$ ); } ; %printer { report (yyo, $$, $$); } <>; %initial-action { $$ = 42; $$ = 4.2f; } %% float: UNTYPED INT { $$ = $1 + $2; $$ = $1 + $2; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static int const input[] = {yy::parser::token::UNTYPED, yy::parser::token::INT, EOF}; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; (*lvalp).ival = toknum * 10; (*lvalp).fval = YY_CAST (float, toknum) / 10.0f;; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); 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:1808: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1808: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1808" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1808" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1808: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1808" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1808" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1808: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1808" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1808" { set +x $as_echo "$at_srcdir/actions.at:1808: \$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:1808" ( $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:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1808" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1808" $at_failed && at_fn_log_failure $at_traceon; } # Don't be too picky on the traces, GLR is not exactly the same. Keep # only the lines from the printer. { set +x $as_echo "$at_srcdir/actions.at:1808: sed -ne '/ival:/p' stderr" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; sed -ne '/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) Shifting token UNTYPED (ival: 10, fval: 0.1) Reading a token: Next token is token INT (ival: 20, fval: 0.2) Shifting token INT (ival: 20, fval: 0.2) \$1 = token UNTYPED (ival: 10, fval: 0.1) \$2 = token INT (ival: 20, fval: 0.2) -> \$\$ = nterm float (ival: 30, fval: 0.3) Cleanup: popping nterm float (ival: 30, fval: 0.3) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1808' \ "Qualified \$\$ in actions: glr.cc" " " 12 at_xfail=no ( $as_echo "317. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.cc" %debug %code requires { typedef struct sem_type { int ival; float fval; } sem_type; # define YYSTYPE sem_type # include // EOF. # include namespace { void report (std::ostream& yyo, int ival, float fval) { yyo << "ival: " << ival << ", fval: " << fval; } } } %code { static int yylex (yy::parser::semantic_type *lvalp); } %token UNTYPED %token INT %type float %printer { report (yyo, $$, $$); } ; %printer { report (yyo, $$, $$ ); } ; %printer { report (yyo, $$, $$); } <>; %initial-action { $$ = 42; $$ = 4.2f; } %% float: UNTYPED INT { $$ = $1 + $2; $$ = $1 + $2; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static int const input[] = {yy::parser::token::UNTYPED, yy::parser::token::INT, EOF}; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; (*lvalp).ival = toknum * 10; (*lvalp).fval = YY_CAST (float, toknum) / 10.0f;; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); 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:1808: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1808: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1808" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1808" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1808: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1808" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1808" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/actions.at:1808: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1808" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1808" { set +x $as_echo "$at_srcdir/actions.at:1808: \$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:1808" ( $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:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1808" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1808: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1808" $at_failed && at_fn_log_failure $at_traceon; } # Don't be too picky on the traces, GLR is not exactly the same. Keep # only the lines from the printer. { set +x $as_echo "$at_srcdir/actions.at:1808: sed -ne '/ival:/p' stderr" at_fn_check_prepare_trace "actions.at:1808" ( $at_check_trace; sed -ne '/ival:/p' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "Reading a token: Next token is token UNTYPED (ival: 10, fval: 0.1) Shifting token UNTYPED (ival: 10, fval: 0.1) Reading a token: Next token is token INT (ival: 20, fval: 0.2) Shifting token INT (ival: 20, fval: 0.2) \$1 = token UNTYPED (ival: 10, fval: 0.1) \$2 = token INT (ival: 20, fval: 0.2) -> \$\$ = nterm float (ival: 30, fval: 0.3) Cleanup: popping nterm float (ival: 30, fval: 0.3) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1808" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1815' \ "Destroying lookahead assigned by semantic action" "" 12 at_xfail=no ( $as_echo "318. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include #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; } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/actions.at:1857: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1857" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1857: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1857" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1857" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1857: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1857" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1857" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1857: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1857" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1857" $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:1857: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1857" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1857" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1858" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1858" { set +x $as_echo "$at_srcdir/actions.at:1858: \$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:1858" ( $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:1858" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1862: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1862" ( $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:1862" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1862: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1862" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1862" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'actions.at:1870' \ "YYBACKUP" " " 12 at_xfail=no ( $as_echo "319. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.error verbose %debug %define api.pure %code { # include # 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); } ; %% /* 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 int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; *lvalp = (toknum + 1) * 10; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1905: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1905" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1905: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1905" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/actions.at:1905: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1905" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1905" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/actions.at:1905: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1905" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1905" $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:1905: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "actions.at:1905" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "actions.at:1906" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/actions.at:1906" { set +x $as_echo "$at_srcdir/actions.at:1906: \$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:1906" ( $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:1906" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1910: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1910" ( $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:1910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/actions.at:1910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "actions.at:1910" ( $at_check_trace; 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:1910" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:25' \ "%union vs. api.value.type" " " 13 at_xfail=no ( $as_echo "320. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %union { int ival; } %define api.value.type union-directive %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/types.at:36: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "types.at:36" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-38: error: '%union' and '%define api.value.type' cannot be used together " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/types.at:36" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:44' \ "%yacc vs. api.value.type=union" " " 13 at_xfail=no ( $as_echo "321. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %yacc %define api.value.type union %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/types.at:55: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "types.at:55" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-28: error: '%yacc' and '%define api.value.type \"union\"' cannot be used together " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/types.at: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_321 #AT_START_322 at_fn_group_banner 322 'types.at:366' \ "yacc.c api.value.type={double}" " " 13 at_xfail=no ( $as_echo "322. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {double} %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (yylval) = (res - '0') / 10.0; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={double} %defines" " " 13 at_xfail=no ( $as_echo "323. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {double} %defines %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (yylval) = (res - '0') / 10.0; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={variant}" " " 13 at_xfail=no ( $as_echo "324. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {variant} %code requires { typedef double variant; } %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (yylval) = (res - '0') / 10.0; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={variant} %defines" " " 13 at_xfail=no ( $as_echo "325. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {variant} %defines %code requires { typedef double variant; } %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (yylval) = (res - '0') / 10.0; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={struct foo}" " " 13 at_xfail=no ( $as_echo "326. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {struct foo} %code requires { struct foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (yylval).ival = (res - '0') * 10; (yylval).fval = YY_CAST (float, res - '0') / 10.f; }; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "30 0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={struct foo} %defines" " " 13 at_xfail=no ( $as_echo "327. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {struct foo} %defines %code requires { struct foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (yylval).ival = (res - '0') * 10; (yylval).fval = YY_CAST (float, res - '0') / 10.f; }; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "30 0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={struct bar}" " " 13 at_xfail=no ( $as_echo "328. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {struct bar} %code requires { struct u { int ival; }; struct bar { struct u *up; }; } %token ival> '1' '2' %printer { fprintf (yyo, "%d", $$); } ival> %% start: '1' '2' { printf ("%d %d\n", $1, $ival>2); free ($1); free ($2); }; %% /* 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[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (yylval).up = YY_CAST (struct u *, malloc (sizeof *(yylval).up)); assert ((yylval).up); (yylval).up->ival = res - '0'; } ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={struct bar} %defines" " " 13 at_xfail=no ( $as_echo "329. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {struct bar} %defines %code requires { struct u { int ival; }; struct bar { struct u *up; }; } %token ival> '1' '2' %printer { fprintf (yyo, "%d", $$); } ival> %% start: '1' '2' { printf ("%d %d\n", $1, $ival>2); free ($1); free ($2); }; %% /* 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[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (yylval).up = YY_CAST (struct u *, malloc (sizeof *(yylval).up)); assert ((yylval).up); (yylval).up->ival = res - '0'; } ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={union foo}" " " 13 at_xfail=no ( $as_echo "330. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {union foo} %code requires { union foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = .2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type={union foo} %defines" " " 13 at_xfail=no ( $as_echo "331. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type {union foo} %defines %code requires { union foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = .2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c %union { float fval; int ival; };" " " 13 at_xfail=no ( $as_echo "332. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %union { float fval; int ival; }; %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c %union { float fval; int ival; }; %defines" "" 13 at_xfail=no ( $as_echo "333. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %union { float fval; int ival; }; %defines %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c %union foo { float fval; int ival; };" " " 13 at_xfail=no ( $as_echo "334. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %union foo { float fval; int ival; }; %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c %union foo { float fval; int ival; }; %defines" "" 13 at_xfail=no ( $as_echo "335. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %union foo { float fval; int ival; }; %defines %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.union.name=foo; %union { float fval; int ival; };" "" 13 at_xfail=no ( $as_echo "336. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.union.name foo; %union { float fval; int ival; }; %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.union.name=foo; %union { float fval; int ival; }; %defines" "" 13 at_xfail=no ( $as_echo "337. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.union.name foo; %union { float fval; int ival; }; %defines %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type=union" " " 13 at_xfail=no ( $as_echo "338. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type union %token ONE 101; %token TWO 102 THREE 103; %printer { fprintf (yyo, "%d", $$); } %printer { fprintf (yyo, "%f", $$); } %% start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { 101, 102, 103, EOF }; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == 101) (yylval).ONE = 10; else if (res == 102) (yylval).TWO = .2f; else if (res == 103) (yylval).THREE = 3.3f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 3.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "yacc.c api.value.type=union %defines" " " 13 at_xfail=no ( $as_echo "339. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "yacc.c" %define api.value.type union %defines %token ONE 101; %token TWO 102 THREE 103; %printer { fprintf (yyo, "%d", $$); } %printer { fprintf (yyo, "%f", $$); } %% start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { 101, 102, 103, EOF }; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == 101) (yylval).ONE = 10; else if (res == 102) (yylval).TWO = .2f; else if (res == 103) (yylval).THREE = 3.3f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 3.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={double}" " " 13 at_xfail=no ( $as_echo "340. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {double} %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (yylval) = (res - '0') / 10.0; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={double} %defines" " " 13 at_xfail=no ( $as_echo "341. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {double} %defines %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (yylval) = (res - '0') / 10.0; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={variant}" " " 13 at_xfail=no ( $as_echo "342. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {variant} %code requires { typedef double variant; } %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (yylval) = (res - '0') / 10.0; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={variant} %defines" " " 13 at_xfail=no ( $as_echo "343. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {variant} %defines %code requires { typedef double variant; } %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (yylval) = (res - '0') / 10.0; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={struct foo}" " " 13 at_xfail=no ( $as_echo "344. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {struct foo} %code requires { struct foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (yylval).ival = (res - '0') * 10; (yylval).fval = YY_CAST (float, res - '0') / 10.f; }; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "30 0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={struct foo} %defines" " " 13 at_xfail=no ( $as_echo "345. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {struct foo} %defines %code requires { struct foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (yylval).ival = (res - '0') * 10; (yylval).fval = YY_CAST (float, res - '0') / 10.f; }; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "30 0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={struct bar}" " " 13 at_xfail=no ( $as_echo "346. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {struct bar} %code requires { struct u { int ival; }; struct bar { struct u *up; }; } %token ival> '1' '2' %printer { fprintf (yyo, "%d", $$); } ival> %% start: '1' '2' { printf ("%d %d\n", $1, $ival>2); free ($1); free ($2); }; %% /* 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[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (yylval).up = YY_CAST (struct u *, malloc (sizeof *(yylval).up)); assert ((yylval).up); (yylval).up->ival = res - '0'; } ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={struct bar} %defines" " " 13 at_xfail=no ( $as_echo "347. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {struct bar} %defines %code requires { struct u { int ival; }; struct bar { struct u *up; }; } %token ival> '1' '2' %printer { fprintf (yyo, "%d", $$); } ival> %% start: '1' '2' { printf ("%d %d\n", $1, $ival>2); free ($1); free ($2); }; %% /* 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[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (yylval).up = YY_CAST (struct u *, malloc (sizeof *(yylval).up)); assert ((yylval).up); (yylval).up->ival = res - '0'; } ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={union foo}" " " 13 at_xfail=no ( $as_echo "348. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {union foo} %code requires { union foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = .2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c api.value.type={union foo} %defines" " " 13 at_xfail=no ( $as_echo "349. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type {union foo} %defines %code requires { union foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = .2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c %union { float fval; int ival; };" " " 13 at_xfail=no ( $as_echo "350. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %union { float fval; int ival; }; %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c %union { float fval; int ival; }; %defines" "" 13 at_xfail=no ( $as_echo "351. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %union { float fval; int ival; }; %defines %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $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 'types.at:366' \ "glr.c %union foo { float fval; int ival; };" " " 13 at_xfail=no ( $as_echo "352. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %union foo { float fval; int ival; }; %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_352 #AT_START_353 at_fn_group_banner 353 'types.at:366' \ "glr.c %union foo { float fval; int ival; }; %defines" "" 13 at_xfail=no ( $as_echo "353. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %union foo { float fval; int ival; }; %defines %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_353 #AT_START_354 at_fn_group_banner 354 'types.at:366' \ "glr.c api.value.union.name=foo; %union { float fval; int ival; };" "" 13 at_xfail=no ( $as_echo "354. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.union.name foo; %union { float fval; int ival; }; %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_354 #AT_START_355 at_fn_group_banner 355 'types.at:366' \ "glr.c api.value.union.name=foo; %union { float fval; int ival; }; %defines" "" 13 at_xfail=no ( $as_echo "355. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.union.name foo; %union { float fval; int ival; }; %defines %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (yylval).ival = 10; else if (res == '2') (yylval).fval = 0.2f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_355 #AT_START_356 at_fn_group_banner 356 'types.at:366' \ "glr.c api.value.type=union" " " 13 at_xfail=no ( $as_echo "356. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type union %token ONE 101; %token TWO 102 THREE 103; %printer { fprintf (yyo, "%d", $$); } %printer { fprintf (yyo, "%f", $$); } %% start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { 101, 102, 103, EOF }; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == 101) (yylval).ONE = 10; else if (res == 102) (yylval).TWO = .2f; else if (res == 103) (yylval).THREE = 3.3f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 3.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_356 #AT_START_357 at_fn_group_banner 357 'types.at:366' \ "glr.c api.value.type=union %defines" " " 13 at_xfail=no ( $as_echo "357. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include #include static void yyerror (const char *msg); static int yylex (void); } %skeleton "glr.c" %define api.value.type union %defines %token ONE 101; %token TWO 102 THREE 103; %printer { fprintf (yyo, "%d", $$); } %printer { fprintf (yyo, "%f", $$); } %% start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { 101, 102, 103, EOF }; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == 101) (yylval).ONE = 10; else if (res == 102) (yylval).TWO = .2f; else if (res == 103) (yylval).THREE = 3.3f; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.c test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.c test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:366" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 3.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_357 #AT_START_358 at_fn_group_banner 358 'types.at:366' \ "lalr1.cc api.value.type={double}" " " 13 at_xfail=no ( $as_echo "358. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {double} %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (*lvalp) = (res - '0') / 10.0; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_358 #AT_START_359 at_fn_group_banner 359 'types.at:366' \ "lalr1.cc api.value.type={double} %defines" " " 13 at_xfail=no ( $as_echo "359. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {double} %defines %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (*lvalp) = (res - '0') / 10.0; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_359 #AT_START_360 at_fn_group_banner 360 'types.at:366' \ "lalr1.cc api.value.type={variant}" " " 13 at_xfail=no ( $as_echo "360. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {variant} %code requires { typedef double variant; } %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (*lvalp) = (res - '0') / 10.0; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_360 #AT_START_361 at_fn_group_banner 361 'types.at:366' \ "lalr1.cc api.value.type={variant} %defines" " " 13 at_xfail=no ( $as_echo "361. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {variant} %defines %code requires { typedef double variant; } %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (*lvalp) = (res - '0') / 10.0; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_361 #AT_START_362 at_fn_group_banner 362 'types.at:366' \ "lalr1.cc api.value.type={struct foo}" " " 13 at_xfail=no ( $as_echo "362. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {struct foo} %code requires { struct foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (*lvalp).ival = (res - '0') * 10; (*lvalp).fval = YY_CAST (float, res - '0') / 10.f; }; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "30 0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_362 #AT_START_363 at_fn_group_banner 363 'types.at:366' \ "lalr1.cc api.value.type={struct foo} %defines" " " 13 at_xfail=no ( $as_echo "363. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {struct foo} %defines %code requires { struct foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (*lvalp).ival = (res - '0') * 10; (*lvalp).fval = YY_CAST (float, res - '0') / 10.f; }; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "30 0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_363 #AT_START_364 at_fn_group_banner 364 'types.at:366' \ "lalr1.cc api.value.type={struct bar}" " " 13 at_xfail=no ( $as_echo "364. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {struct bar} %code requires { struct u { int ival; }; struct bar { struct u *up; }; } %token ival> '1' '2' %printer { yyo << $$; } ival> %% start: '1' '2' { printf ("%d %d\n", $1, $ival>2); free ($1); free ($2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up)); assert ((*lvalp).up); (*lvalp).up->ival = res - '0'; } ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_364 #AT_START_365 at_fn_group_banner 365 'types.at:366' \ "lalr1.cc api.value.type={struct bar} %defines" " " 13 at_xfail=no ( $as_echo "365. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {struct bar} %defines %code requires { struct u { int ival; }; struct bar { struct u *up; }; } %token ival> '1' '2' %printer { yyo << $$; } ival> %% start: '1' '2' { printf ("%d %d\n", $1, $ival>2); free ($1); free ($2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up)); assert ((*lvalp).up); (*lvalp).up->ival = res - '0'; } ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_365 #AT_START_366 at_fn_group_banner 366 'types.at:366' \ "lalr1.cc api.value.type={union foo}" " " 13 at_xfail=no ( $as_echo "366. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {union foo} %code requires { union foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).ival = 10; else if (res == '2') (*lvalp).fval = .2f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_366 #AT_START_367 at_fn_group_banner 367 'types.at:366' \ "lalr1.cc api.value.type={union foo} %defines" " " 13 at_xfail=no ( $as_echo "367. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type {union foo} %defines %code requires { union foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).ival = 10; else if (res == '2') (*lvalp).fval = .2f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_367 #AT_START_368 at_fn_group_banner 368 'types.at:366' \ "lalr1.cc %union { float fval; int ival; };" " " 13 at_xfail=no ( $as_echo "368. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %union { float fval; int ival; }; %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).ival = 10; else if (res == '2') (*lvalp).fval = 0.2f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_368 #AT_START_369 at_fn_group_banner 369 'types.at:366' \ "lalr1.cc %union { float fval; int ival; }; %defines" "" 13 at_xfail=no ( $as_echo "369. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %union { float fval; int ival; }; %defines %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).ival = 10; else if (res == '2') (*lvalp).fval = 0.2f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_369 #AT_START_370 at_fn_group_banner 370 'types.at:366' \ "lalr1.cc api.value.type=union" " " 13 at_xfail=no ( $as_echo "370. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type union %token ONE 101; %token TWO 102 THREE 103; %printer { yyo << $$; } %printer { yyo << $$; } %% start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static int const input[] = { 101, 102, 103, EOF }; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == 101) (*lvalp).ONE = 10; else if (res == 102) (*lvalp).TWO = .2f; else if (res == 103) (*lvalp).THREE = 3.3f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 3.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_370 #AT_START_371 at_fn_group_banner 371 'types.at:366' \ "lalr1.cc api.value.type=union %defines" " " 13 at_xfail=no ( $as_echo "371. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type union %defines %token ONE 101; %token TWO 102 THREE 103; %printer { yyo << $$; } %printer { yyo << $$; } %% start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static int const input[] = { 101, 102, 103, EOF }; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == 101) (*lvalp).ONE = 10; else if (res == 102) (*lvalp).TWO = .2f; else if (res == 103) (*lvalp).THREE = 3.3f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 3.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_371 #AT_START_372 at_fn_group_banner 372 'types.at:366' \ "lalr1.cc api.value.type=variant" " " 13 at_xfail=no ( $as_echo "372. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type variant %token '1'; %token '2'; %% start: '1' '2' { std::cout << $1 << ", " << $2 << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).build (10); else if (res == '2') (*lvalp).build ("two");; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, two " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_372 #AT_START_373 at_fn_group_banner 373 'types.at:366' \ "lalr1.cc api.value.type=variant %defines" " " 13 at_xfail=no ( $as_echo "373. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type variant %defines %token '1'; %token '2'; %% start: '1' '2' { std::cout << $1 << ", " << $2 << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).build (10); else if (res == '2') (*lvalp).build ("two");; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, two " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_373 #AT_START_374 at_fn_group_banner 374 'types.at:366' \ "lalr1.cc api.value.type=variant" " " 13 at_xfail=no ( $as_echo "374. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type variant %token > '1'; %token > '2'; %% start: '1' '2' { std::cout << $1.first << ':' << $1.second << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).build (std::make_pair (10, 11)); else if (res == '2') (*lvalp).build (std::pair ("two", "deux"));; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10:11, two:deux " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_374 #AT_START_375 at_fn_group_banner 375 'types.at:366' \ "lalr1.cc api.value.type=variant %defines" " " 13 at_xfail=no ( $as_echo "375. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %define api.value.type variant %defines %token > '1'; %token > '2'; %% start: '1' '2' { std::cout << $1.first << ':' << $1.second << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).build (std::make_pair (10, 11)); else if (res == '2') (*lvalp).build (std::pair ("two", "deux"));; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10:11, two:deux " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_375 #AT_START_376 at_fn_group_banner 376 'types.at:366' \ "lalr1.cc api.value.type=variant api.token.constructor" "" 13 at_xfail=no ( $as_echo "376. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static yy::parser::symbol_type yylex (); } %skeleton "lalr1.cc" %define api.value.type variant %define api.token.constructor %token > '1' '2'; %% start: '1' '2' { std::cout << $1.first << ':' << $1.second << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static yy::parser::symbol_type yylex () { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; typedef yy::parser::symbol_type symbol; if (res) return symbol (res, std::make_pair (res - '0', res - '0' + 1)); else return symbol (res); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1:2, 2:3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_376 #AT_START_377 at_fn_group_banner 377 'types.at:366' \ "lalr1.cc api.value.type=variant api.token.constructor %defines" "" 13 at_xfail=no ( $as_echo "377. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static yy::parser::symbol_type yylex (); } %skeleton "lalr1.cc" %define api.value.type variant %define api.token.constructor %defines %token > '1' '2'; %% start: '1' '2' { std::cout << $1.first << ':' << $1.second << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static yy::parser::symbol_type yylex () { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; typedef yy::parser::symbol_type symbol; if (res) return symbol (res, std::make_pair (res - '0', res - '0' + 1)); else return symbol (res); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1:2, 2:3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_377 #AT_START_378 at_fn_group_banner 378 'types.at:366' \ "lalr1.cc %code requires { #include } api.value.type=variant" "" 13 at_xfail=no ( $as_echo "378. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %code requires { #include } %define api.value.type variant %token > '1'; %token > '2'; %% start: '1' '2' { std::cout << *$1 << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).emplace > (std::make_unique (10)); else if (res == '2') (*lvalp).emplace > (21, 22);; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" cat >check.cc <<'_ATEOF' int main () { #if !defined __cplusplus || __cplusplus < 201402 return 1; #else return 0; #endif } _ATEOF $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o check check.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: ./check" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; ./check ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status != 0; then echo "$at_std not supported"; continue 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/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, 21:22 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_378 #AT_START_379 at_fn_group_banner 379 'types.at:366' \ "lalr1.cc %code requires { #include } api.value.type=variant %defines" "" 13 at_xfail=no ( $as_echo "379. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %code requires { #include } %define api.value.type variant %defines %token > '1'; %token > '2'; %% start: '1' '2' { std::cout << *$1 << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).emplace > (std::make_unique (10)); else if (res == '2') (*lvalp).emplace > (21, 22);; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" cat >check.cc <<'_ATEOF' int main () { #if !defined __cplusplus || __cplusplus < 201402 return 1; #else return 0; #endif } _ATEOF $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o check check.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: ./check" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; ./check ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status != 0; then echo "$at_std not supported"; continue 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/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, 21:22 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_379 #AT_START_380 at_fn_group_banner 380 'types.at:366' \ "lalr1.cc %code requires { #include } api.value.type=variant api.token.constructor" "" 13 at_xfail=no ( $as_echo "380. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static yy::parser::symbol_type yylex (); } %skeleton "lalr1.cc" %code requires { #include } %define api.value.type variant %define api.token.constructor %token > ONE; %token > TWO; %token EOI 0; %% start: ONE TWO { std::cout << *$1 << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static yy::parser::symbol_type yylex () { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') return yy::parser::make_ONE (std::make_unique (10)); else if (res == '2') return yy::parser::make_TWO (std::make_pair (21, 22)); else return yy::parser::make_EOI (); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" cat >check.cc <<'_ATEOF' int main () { #if !defined __cplusplus || __cplusplus < 201402 return 1; #else return 0; #endif } _ATEOF $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o check check.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: ./check" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; ./check ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status != 0; then echo "$at_std not supported"; continue 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/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, 21:22 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_380 #AT_START_381 at_fn_group_banner 381 'types.at:366' \ "lalr1.cc %code requires { #include } api.value.type=variant api.token.constructor %defines" "" 13 at_xfail=no ( $as_echo "381. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static yy::parser::symbol_type yylex (); } %skeleton "lalr1.cc" %code requires { #include } %define api.value.type variant %define api.token.constructor %defines %token > ONE; %token > TWO; %token EOI 0; %% start: ONE TWO { std::cout << *$1 << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static yy::parser::symbol_type yylex () { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') return yy::parser::make_ONE (std::make_unique (10)); else if (res == '2') return yy::parser::make_TWO (std::make_pair (21, 22)); else return yy::parser::make_EOI (); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" cat >check.cc <<'_ATEOF' int main () { #if !defined __cplusplus || __cplusplus < 201402 return 1; #else return 0; #endif } _ATEOF $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o check check.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: ./check" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; ./check ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status != 0; then echo "$at_std not supported"; continue 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/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, 21:22 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_381 #AT_START_382 at_fn_group_banner 382 'types.at:366' \ "lalr1.cc %code requires { #include } api.value.type=variant api.token.constructor" "" 13 at_xfail=no ( $as_echo "382. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static yy::parser::symbol_type yylex (); } %skeleton "lalr1.cc" %code requires { #include } %define api.value.type variant %define api.token.constructor %token > '1'; %token > '2'; %% start: '1' '2' { std::cout << *$1 << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static yy::parser::symbol_type yylex () { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') return {res, std::make_unique (10)}; else if (res == '2') return {res, std::make_pair (21, 22)}; else return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" cat >check.cc <<'_ATEOF' int main () { #if !defined __cplusplus || __cplusplus < 201402 return 1; #else return 0; #endif } _ATEOF $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o check check.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: ./check" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; ./check ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status != 0; then echo "$at_std not supported"; continue 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/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, 21:22 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_382 #AT_START_383 at_fn_group_banner 383 'types.at:366' \ "lalr1.cc %code requires { #include } api.value.type=variant api.token.constructor %defines" "" 13 at_xfail=no ( $as_echo "383. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static yy::parser::symbol_type yylex (); } %skeleton "lalr1.cc" %code requires { #include } %define api.value.type variant %define api.token.constructor %defines %token > '1'; %token > '2'; %% start: '1' '2' { std::cout << *$1 << ", " << $2.first << ':' << $2.second << '\n'; }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static yy::parser::symbol_type yylex () { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') return {res, std::make_unique (10)}; else if (res == '2') return {res, std::make_pair (21, 22)}; else return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" cat >check.cc <<'_ATEOF' int main () { #if !defined __cplusplus || __cplusplus < 201402 return 1; #else return 0; #endif } _ATEOF $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o check check.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: ./check" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; ./check ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status != 0; then echo "$at_std not supported"; continue 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/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, 21:22 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_383 #AT_START_384 at_fn_group_banner 384 'types.at:366' \ "glr.cc api.value.type={double}" " " 13 at_xfail=no ( $as_echo "384. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {double} %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (*lvalp) = (res - '0') / 10.0; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_384 #AT_START_385 at_fn_group_banner 385 'types.at:366' \ "glr.cc api.value.type={double} %defines" " " 13 at_xfail=no ( $as_echo "385. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {double} %defines %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (*lvalp) = (res - '0') / 10.0; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_385 #AT_START_386 at_fn_group_banner 386 'types.at:366' \ "glr.cc api.value.type={variant}" " " 13 at_xfail=no ( $as_echo "386. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {variant} %code requires { typedef double variant; } %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (*lvalp) = (res - '0') / 10.0; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_386 #AT_START_387 at_fn_group_banner 387 'types.at:366' \ "glr.cc api.value.type={variant} %defines" " " 13 at_xfail=no ( $as_echo "387. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {variant} %defines %code requires { typedef double variant; } %% start: '1' '2' { printf ("%2.1f\n", $1 + $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) (*lvalp) = (res - '0') / 10.0; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_387 #AT_START_388 at_fn_group_banner 388 'types.at:366' \ "glr.cc api.value.type={struct foo}" " " 13 at_xfail=no ( $as_echo "388. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {struct foo} %code requires { struct foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (*lvalp).ival = (res - '0') * 10; (*lvalp).fval = YY_CAST (float, res - '0') / 10.f; }; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "30 0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_388 #AT_START_389 at_fn_group_banner 389 'types.at:366' \ "glr.cc api.value.type={struct foo} %defines" " " 13 at_xfail=no ( $as_echo "389. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {struct foo} %defines %code requires { struct foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (*lvalp).ival = (res - '0') * 10; (*lvalp).fval = YY_CAST (float, res - '0') / 10.f; }; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "30 0.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_389 #AT_START_390 at_fn_group_banner 390 'types.at:366' \ "glr.cc api.value.type={struct bar}" " " 13 at_xfail=no ( $as_echo "390. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {struct bar} %code requires { struct u { int ival; }; struct bar { struct u *up; }; } %token ival> '1' '2' %printer { yyo << $$; } ival> %% start: '1' '2' { printf ("%d %d\n", $1, $ival>2); free ($1); free ($2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up)); assert ((*lvalp).up); (*lvalp).up->ival = res - '0'; } ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_390 #AT_START_391 at_fn_group_banner 391 'types.at:366' \ "glr.cc api.value.type={struct bar} %defines" " " 13 at_xfail=no ( $as_echo "391. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {struct bar} %defines %code requires { struct u { int ival; }; struct bar { struct u *up; }; } %token ival> '1' '2' %printer { yyo << $$; } ival> %% start: '1' '2' { printf ("%d %d\n", $1, $ival>2); free ($1); free ($2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res) { (*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up)); assert ((*lvalp).up); (*lvalp).up->ival = res - '0'; } ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "1 2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_391 #AT_START_392 at_fn_group_banner 392 'types.at:366' \ "glr.cc api.value.type={union foo}" " " 13 at_xfail=no ( $as_echo "392. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {union foo} %code requires { union foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).ival = 10; else if (res == '2') (*lvalp).fval = .2f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_392 #AT_START_393 at_fn_group_banner 393 'types.at:366' \ "glr.cc api.value.type={union foo} %defines" " " 13 at_xfail=no ( $as_echo "393. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type {union foo} %defines %code requires { union foo { float fval; int ival; }; } %% start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).ival = 10; else if (res == '2') (*lvalp).fval = .2f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_393 #AT_START_394 at_fn_group_banner 394 'types.at:366' \ "glr.cc %union { float fval; int ival; };" " " 13 at_xfail=no ( $as_echo "394. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %union { float fval; int ival; }; %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).ival = 10; else if (res == '2') (*lvalp).fval = 0.2f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_394 #AT_START_395 at_fn_group_banner 395 'types.at:366' \ "glr.cc %union { float fval; int ival; }; %defines" "" 13 at_xfail=no ( $as_echo "395. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %union { float fval; int ival; }; %defines %token '1'; %token '2'; %% start: '1' '2' { printf ("%d %2.1f\n", $1, $2); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "12"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') (*lvalp).ival = 10; else if (res == '2') (*lvalp).fval = 0.2f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_395 #AT_START_396 at_fn_group_banner 396 'types.at:366' \ "glr.cc api.value.type=union" " " 13 at_xfail=no ( $as_echo "396. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type union %token ONE 101; %token TWO 102 THREE 103; %printer { yyo << $$; } %printer { yyo << $$; } %% start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static int const input[] = { 101, 102, 103, EOF }; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == 101) (*lvalp).ONE = 10; else if (res == 102) (*lvalp).TWO = .2f; else if (res == 103) (*lvalp).THREE = 3.3f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 3.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_396 #AT_START_397 at_fn_group_banner 397 'types.at:366' \ "glr.cc api.value.type=union %defines" " " 13 at_xfail=no ( $as_echo "397. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %code { # include # include static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "glr.cc" %define api.value.type union %defines %token ONE 101; %token TWO 102 THREE 103; %printer { yyo << $$; } %printer { yyo << $$; } %% start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); }; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static int const input[] = { 101, 102, 103, EOF }; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == 101) (*lvalp).ONE = 10; else if (res == 102) (*lvalp).TWO = .2f; else if (res == 103) (*lvalp).THREE = 3.3f; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/types.at:366: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:366" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/types.at:366: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "types.at:366" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/types.at:366" { set +x $as_echo "$at_srcdir/types.at:366: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:366" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:366" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10 0.2 3.3 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/types.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "types.at:366" ( $at_check_trace; 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/types.at:366" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_397 #AT_START_398 at_fn_group_banner 398 'types.at:388' \ "lalr1.cc: Named %union" " " 13 at_xfail=no ( $as_echo "398. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %skeleton "lalr1.cc" %union foo { float fval; int ival; }; %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/types.at:388: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "types.at:388" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.8-10: error: named %union is invalid in C++ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/types.at:388" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_398 #AT_START_399 at_fn_group_banner 399 'types.at:388' \ "glr.cc: Named %union" " " 13 at_xfail=no ( $as_echo "399. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %skeleton "glr.cc" %union foo { float fval; int ival; }; %% exp: %empty; _ATEOF { set +x $as_echo "$at_srcdir/types.at:388: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "types.at:388" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.8-10: error: named %union is invalid in C++ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/types.at:388" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_399 #AT_START_400 at_fn_group_banner 400 'scanner.at:338' \ "Token numbers: yacc.c" " " 14 at_xfail=no ( $as_echo "400. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "yacc.c" %debug %code { #include #include static void yyerror (const char *msg); static int yylex (void); } %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include /* abort */ int yylex (void) { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (yylval).val = c - '0'; return NUM; case '+': return PLUS; case '-': return MINUS; case '*': return STAR; case '/': return SLASH; case '(': return LPAR; case ')': return RPAR; case 0: return 0; } abort (); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.c" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' 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 "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_400 #AT_START_401 at_fn_group_banner 401 'scanner.at:338' \ "Token numbers: yacc.c api.token.raw" " " 14 at_xfail=no ( $as_echo "401. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "yacc.c" %define api.token.raw %debug %code { #include #include static void yyerror (const char *msg); static int yylex (void); } %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include /* abort */ int yylex (void) { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (yylval).val = c - '0'; return NUM; case '+': return PLUS; case '-': return MINUS; case '*': return STAR; case '/': return SLASH; case '(': return LPAR; case ')': return RPAR; case 0: return 0; } abort (); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.c" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' 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 "0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_401 #AT_START_402 at_fn_group_banner 402 'scanner.at:338' \ "Token numbers: glr.c" " " 14 at_xfail=no ( $as_echo "402. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.c" %debug %code { #include #include static void yyerror (const char *msg); static int yylex (void); } %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include /* abort */ int yylex (void) { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (yylval).val = c - '0'; return NUM; case '+': return PLUS; case '-': return MINUS; case '*': return STAR; case '/': return SLASH; case '(': return LPAR; case ')': return RPAR; case 0: return 0; } abort (); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.c" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' 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 "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_402 #AT_START_403 at_fn_group_banner 403 'scanner.at:338' \ "Token numbers: glr.c api.token.raw" " " 14 at_xfail=no ( $as_echo "403. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.c" %define api.token.raw %debug %code { #include #include static void yyerror (const char *msg); static int yylex (void); } %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include /* abort */ int yylex (void) { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (yylval).val = c - '0'; return NUM; case '+': return PLUS; case '-': return MINUS; case '*': return STAR; case '/': return SLASH; case '(': return LPAR; case ')': return RPAR; case 0: return 0; } abort (); } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.c" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' 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 "0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_403 #AT_START_404 at_fn_group_banner 404 'scanner.at:338' \ "Token numbers: lalr1.cc" " " 14 at_xfail=no ( $as_echo "404. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %debug %code { #include static int yylex (yy::parser::semantic_type *lvalp); } %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include /* abort */ int yylex (yy::parser::semantic_type *lvalp) { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (*lvalp).val = c - '0'; return yy::parser::token::NUM; case '+': return yy::parser::token::PLUS; case '-': return yy::parser::token::MINUS; case '*': return yy::parser::token::STAR; case '/': return yy::parser::token::SLASH; case '(': return yy::parser::token::LPAR; case ')': return yy::parser::token::RPAR; case 0: return yy::parser::token::END; } abort (); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_404 #AT_START_405 at_fn_group_banner 405 'scanner.at:338' \ "Token numbers: lalr1.cc api.token.raw" " " 14 at_xfail=no ( $as_echo "405. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %define api.token.raw %debug %code { #include static int yylex (yy::parser::semantic_type *lvalp); } %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include /* abort */ int yylex (yy::parser::semantic_type *lvalp) { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (*lvalp).val = c - '0'; return yy::parser::token::NUM; case '+': return yy::parser::token::PLUS; case '-': return yy::parser::token::MINUS; case '*': return yy::parser::token::STAR; case '/': return yy::parser::token::SLASH; case '(': return yy::parser::token::LPAR; case ')': return yy::parser::token::RPAR; case 0: return yy::parser::token::END; } abort (); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_405 #AT_START_406 at_fn_group_banner 406 'scanner.at:338' \ "Token numbers: glr.cc" " " 14 at_xfail=no ( $as_echo "406. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.cc" %debug %code { #include static int yylex (yy::parser::semantic_type *lvalp); } %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include /* abort */ int yylex (yy::parser::semantic_type *lvalp) { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (*lvalp).val = c - '0'; return yy::parser::token::NUM; case '+': return yy::parser::token::PLUS; case '-': return yy::parser::token::MINUS; case '*': return yy::parser::token::STAR; case '/': return yy::parser::token::SLASH; case '(': return yy::parser::token::LPAR; case ')': return yy::parser::token::RPAR; case 0: return yy::parser::token::END; } abort (); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_406 #AT_START_407 at_fn_group_banner 407 'scanner.at:338' \ "Token numbers: glr.cc api.token.raw" " " 14 at_xfail=no ( $as_echo "407. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.cc" %define api.token.raw %debug %code { #include static int yylex (yy::parser::semantic_type *lvalp); } %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include /* abort */ int yylex (yy::parser::semantic_type *lvalp) { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (*lvalp).val = c - '0'; return yy::parser::token::NUM; case '+': return yy::parser::token::PLUS; case '-': return yy::parser::token::MINUS; case '*': return yy::parser::token::STAR; case '/': return yy::parser::token::SLASH; case '(': return yy::parser::token::LPAR; case ')': return yy::parser::token::RPAR; case 0: return yy::parser::token::END; } abort (); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_407 #AT_START_408 at_fn_group_banner 408 'scanner.at:338' \ "Token numbers: lalr1.java" " " 14 at_xfail=no ( $as_echo "408. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %skeleton "lalr1.java" %debug %define api.prefix {Calc} %define api.parser.class {Calc} %code imports { import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.io.Reader; import java.io.StreamTokenizer; } %token NUM "number" %type exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { System.out.println ($1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new StringReader ("0-(1+2)*3/9")); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } 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 (); switch (ttype) { case StreamTokenizer.TT_EOF: return EOF; case StreamTokenizer.TT_EOL: return (int) '\n'; case StreamTokenizer.TT_WORD: yylval = new Integer (st.sval); return NUM; case '+': return PLUS; case '-': return MINUS; case '*': return STAR; case '/': return SLASH; case '(': return LPAR; case ')': return RPAR; default: throw new AssertionError ("invalid character: " + ttype); } } } class input { public static void main (String[] args) throws IOException { CalcLexer l = new CalcLexer (System.in); Calc p = new Calc (l); //p.setDebugLevel (1); boolean success = p.parse (); if (!success) System.exit (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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.java input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" $as_echo "scanner.at:338" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$SHELL ../../../javacomp.sh input.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.java" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$SHELL ../../../javaexec.sh input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "scanner.at:338" ( $at_check_trace; $SHELL ../../../javaexec.sh input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_408 #AT_START_409 at_fn_group_banner 409 'scanner.at:338' \ "Token numbers: lalr1.java api.token.raw" " " 14 at_xfail=no ( $as_echo "409. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %skeleton "lalr1.java" %define api.token.raw %debug %define api.prefix {Calc} %define api.parser.class {Calc} %code imports { import java.io.IOException; import java.io.InputStream; import java.io.StringReader; import java.io.Reader; import java.io.StreamTokenizer; } %token NUM "number" %type exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { System.out.println ($1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new StringReader ("0-(1+2)*3/9")); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } 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 (); switch (ttype) { case StreamTokenizer.TT_EOF: return EOF; case StreamTokenizer.TT_EOL: return (int) '\n'; case StreamTokenizer.TT_WORD: yylval = new Integer (st.sval); return NUM; case '+': return PLUS; case '-': return MINUS; case '*': return STAR; case '/': return SLASH; case '(': return LPAR; case ')': return RPAR; default: throw new AssertionError ("invalid character: " + ttype); } } } class input { public static void main (String[] args) throws IOException { CalcLexer l = new CalcLexer (System.in); Calc p = new Calc (l); //p.setDebugLevel (1); boolean success = p.parse (); if (!success) System.exit (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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.java input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" $as_echo "scanner.at:338" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$SHELL ../../../javacomp.sh input.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "scanner.at:338" ( $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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.java" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$SHELL ../../../javaexec.sh input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "scanner.at:338" ( $at_check_trace; $SHELL ../../../javaexec.sh input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_409 #AT_START_410 at_fn_group_banner 410 'scanner.at:338' \ "Token numbers: lalr1.d" " " 14 at_xfail=no ( $as_echo "410. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %skeleton "lalr1.d" %debug %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } import std.range.primitives; import std.stdio; auto yyLexer(R)(R range) if (isInputRange!R && is (ElementType!R : dchar)) { return new YYLexer!R(range); } auto yyLexer () { return yyLexer("0-(1+2)*3/9"); } class YYLexer(R) : Lexer if (isInputRange!R && is (ElementType!R : dchar)) { R input; this(R r) { input = r; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } YYSemanticType semanticVal_; public final @property YYSemanticType semanticVal () { return semanticVal_; } int yylex () { import std.uni : isNumber; // Handle EOF. if (input.empty) return YYTokenType.EOF; auto c = input.front; input.popFront; // Numbers. switch (c) { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': semanticVal_.val = c - '0'; return YYTokenType.NUM; case '+': return YYTokenType.PLUS; case '-': return YYTokenType.MINUS; case '*': return YYTokenType.STAR; case '/': return YYTokenType.SLASH; case '(': return YYTokenType.LPAR; case ')': return YYTokenType.RPAR; default: assert(0); } } } int main () { auto l = yyLexer (); auto p = new YYParser (l); 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.d input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.d input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_DC_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$DC \$DCFLAGS -ofinput input.d" at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofinput input.d" "scanner.at:338" ( $at_check_trace; $DC $DCFLAGS -ofinput input.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.d" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_410 #AT_START_411 at_fn_group_banner 411 'scanner.at:338' \ "Token numbers: lalr1.d api.token.raw" " " 14 at_xfail=no ( $as_echo "411. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %skeleton "lalr1.d" %define api.token.raw %debug %union { int val; } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } import std.range.primitives; import std.stdio; auto yyLexer(R)(R range) if (isInputRange!R && is (ElementType!R : dchar)) { return new YYLexer!R(range); } auto yyLexer () { return yyLexer("0-(1+2)*3/9"); } class YYLexer(R) : Lexer if (isInputRange!R && is (ElementType!R : dchar)) { R input; this(R r) { input = r; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } YYSemanticType semanticVal_; public final @property YYSemanticType semanticVal () { return semanticVal_; } int yylex () { import std.uni : isNumber; // Handle EOF. if (input.empty) return YYTokenType.EOF; auto c = input.front; input.popFront; // Numbers. switch (c) { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': semanticVal_.val = c - '0'; return YYTokenType.NUM; case '+': return YYTokenType.PLUS; case '-': return YYTokenType.MINUS; case '*': return YYTokenType.STAR; case '/': return YYTokenType.SLASH; case '(': return YYTokenType.LPAR; case ')': return YYTokenType.RPAR; default: assert(0); } } } int main () { auto l = yyLexer (); auto p = new YYParser (l); 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/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.d input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y" "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/scanner.at:338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.d input.y" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:338" >"$at_check_line_file" (! $BISON_DC_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:338" { set +x $as_echo "$at_srcdir/scanner.at:338: \$DC \$DCFLAGS -ofinput input.d" at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofinput input.d" "scanner.at:338" ( $at_check_trace; $DC $DCFLAGS -ofinput input.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:338: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.d" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:338" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:338" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:338" ( $at_check_trace; 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/scanner.at:338" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_411 #AT_START_412 at_fn_group_banner 412 'scanner.at:340' \ "Token numbers: lalr1.cc api.token.raw api.value.type=variant api.token.constructor" "" 14 at_xfail=no ( $as_echo "412. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %define api.token.raw %define api.value.type variant %define api.token.constructor %debug %code { #include static yy::parser::symbol_type yylex (); } %token NUM "number" %nterm exp %token PLUS "+" MINUS "-" STAR "*" SLASH "/" LPAR "(" RPAR ")" END 0 %left "+" "-" %left "*" "/" %% input : exp { printf ("%d\n", $1); } ; exp : exp "+" exp { $$ = $1 + $3; } | exp "-" exp { $$ = $1 - $3; } | exp "*" exp { $$ = $1 * $3; } | exp "/" exp { $$ = $1 / $3; } | "(" exp ")" { $$ = $2; } | "number" { $$ = $1; } ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include /* abort */ yy::parser::symbol_type yylex () { static const char* input = "0-(1+2)*3/9"; int c = *input++; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': return yy::parser::make_NUM (c - '0'); case '+': return yy::parser::make_PLUS (); case '-': return yy::parser::make_MINUS (); case '*': return yy::parser::make_STAR (); case '/': return yy::parser::make_SLASH (); case '(': return yy::parser::make_LPAR (); case ')': return yy::parser::make_RPAR (); case 0: return yy::parser::make_END (); } abort (); } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); 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/scanner.at:340: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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/scanner.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:340: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:340" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/scanner.at:340: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:340" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:340" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/scanner.at:340: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:340" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.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/scanner.at:340: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "scanner.at:340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:340" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "scanner.at:340" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/scanner.at:340" { set +x $as_echo "$at_srcdir/scanner.at:340: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:340" ( $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/scanner.at:340" $at_failed && at_fn_log_failure $at_traceon; } # When api.token.raw, the yytranslate table should not be included. # # yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE). # lalr1.cc uses 'translate_table' (and yytranslate_). # lalr1.d uses 'byte[] translate_table =' (and yytranslate_). # lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_). { set +x $as_echo "$at_srcdir/scanner.at:340: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc" at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:340" ( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/scanner.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:340: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:340" ( $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 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/scanner.at:340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "scanner.at:340" ( $at_check_trace; 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/scanner.at:340" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_412 #AT_START_413 at_fn_group_banner 413 'calc.at:750' \ "Calculator " " " 15 at_xfail=no ( $as_echo "413. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:750: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:750" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:750" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:750" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:750: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:750" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:750: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:750" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $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:750: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:750" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:750" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:750" { set +x $as_echo "$at_srcdir/calc.at:750: \$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:750" ( $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:750" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:750: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:750" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $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:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $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:750: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:750" ( $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:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $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:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $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:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:750: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:750" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:750: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:750: cat stderr" at_fn_check_prepare_trace "calc.at:750" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:750" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_413 #AT_START_414 at_fn_group_banner 414 'calc.at:752' \ "Calculator %defines " " " 15 at_xfail=no ( $as_echo "414. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:752: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:752" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:752" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:752" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:752: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:752" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:752: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:752" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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/calc.at:752: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:752" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:752" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:752" { set +x $as_echo "$at_srcdir/calc.at:752: \$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:752" ( $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:752" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:752: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:752" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $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:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $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:752: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:752" ( $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:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $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:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $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:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:752: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:752" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:752: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:752" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:752: cat stderr" at_fn_check_prepare_trace "calc.at:752" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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_414 #AT_START_415 at_fn_group_banner 415 'calc.at:753' \ "Calculator %locations " " " 15 at_xfail=no ( $as_echo "415. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (yylloc).first_column = (yylloc).last_column; (yylloc).first_line = (yylloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:753: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:753" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:753" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:753" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:753: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:753" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:753: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:753" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $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:753: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:753" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:753" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:753" { set +x $as_echo "$at_srcdir/calc.at:753: \$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:753" ( $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:753" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:753: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:753" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $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:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $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:753: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:753" ( $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:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $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:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $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:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:753: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:753" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:753: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:753: cat stderr" at_fn_check_prepare_trace "calc.at:753" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:753" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_415 #AT_START_416 at_fn_group_banner 416 'calc.at:754' \ "Calculator %locations api.location.type={Span} " "" 15 at_xfail=no ( $as_echo "416. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %locations %define api.location.type {Span} %code requires { typedef struct { int l; int c; } Point; typedef struct { Point first; Point last; } Span; # 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 (0) #include void location_print (FILE *o, Span s); #define LOCATION_PRINT location_print /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); int yylex (void); } %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } void location_print (FILE *o, Span s) { fprintf (o, "%d.%d", s.first.l, s.first.c); if (s.first.l != s.last.l) fprintf (o, "-%d.%d", s.last.l, s.last.c - 1); else if (s.first.c != s.last.c - 1) fprintf (o, "-%d", s.last.c - 1); } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (yylloc); if (res == '\n') { (yylloc).last.l++; (yylloc).last.c = 1; } else (yylloc).last.c++; return res; } static void unget_char ( int c) { ; /* Wrong when C == '\n'. */ (yylloc) = last_yylloc; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (yylloc).first.c = (yylloc).last.c; (yylloc).first.l = (yylloc).last.l; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:754: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:754" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:754" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:754" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:754: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:754" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:754: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:754" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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/calc.at:754: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:754" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:754" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:754" { set +x $as_echo "$at_srcdir/calc.at:754: \$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:754" ( $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:754" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:754: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:754" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $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:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $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:754: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:754" ( $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:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $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:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $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:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:754: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:754" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:754: cat stderr" at_fn_check_prepare_trace "calc.at:754" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:754" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_416 #AT_START_417 at_fn_group_banner 417 'calc.at:756' \ "Calculator %name-prefix \"calc\" " " " 15 at_xfail=no ( $as_echo "417. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void calcerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int calclex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:756: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:756" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:756" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:756" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:756: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:756" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:756: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:756" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $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:756: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:756" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:756" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:756" { set +x $as_echo "$at_srcdir/calc.at:756: \$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:756" ( $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:756" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:756: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:756" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $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:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $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:756: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:756" ( $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:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $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:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $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:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:756: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:756" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:756: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:756: cat stderr" at_fn_check_prepare_trace "calc.at:756" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:756" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_417 #AT_START_418 at_fn_group_banner 418 'calc.at:757' \ "Calculator %verbose " " " 15 at_xfail=no ( $as_echo "418. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:757: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:757" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:757" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:757" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:757: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:757" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:757: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:757" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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/calc.at:757: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:757" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:757" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:757" { set +x $as_echo "$at_srcdir/calc.at:757: \$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:757" ( $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:757" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:757: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:757" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $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:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $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:757: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:757" ( $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:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $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:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $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:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:757: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:757" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:757: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:757: cat stderr" at_fn_check_prepare_trace "calc.at:757" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:757" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_418 #AT_START_419 at_fn_group_banner 419 'calc.at:758' \ "Calculator %yacc " " " 15 at_xfail=no ( $as_echo "419. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:758: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:758" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:758" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:758" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:758: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:758" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:758: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:758" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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/calc.at:758: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:758" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:758" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:758" { set +x $as_echo "$at_srcdir/calc.at:758: \$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:758" ( $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:758" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:758: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:758" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $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:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $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:758: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:758" ( $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:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $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:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $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:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:758: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:758" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:758: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:758: cat stderr" at_fn_check_prepare_trace "calc.at:758" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:758" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_419 #AT_START_420 at_fn_group_banner 420 'calc.at:759' \ "Calculator parse.error=verbose " " " 15 at_xfail=no ( $as_echo "420. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define parse.error verbose %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:759: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:759" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:759" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:759" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:759: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:759" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:759: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:759" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $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:759: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:759" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:759" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:759" { set +x $as_echo "$at_srcdir/calc.at:759: \$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:759" ( $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:759" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:759: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:759" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $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:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $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:759: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:759" ( $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:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $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:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $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:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:759: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:759" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:759: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:759: cat stderr" at_fn_check_prepare_trace "calc.at:759" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:759" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_420 #AT_START_421 at_fn_group_banner 421 'calc.at:761' \ "Calculator api.pure=full %locations " " " 15 at_xfail=no ( $as_echo "421. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); 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_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:761: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:761" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:761" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:761" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:761: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:761" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:761: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:761" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $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:761: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:761" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:761" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:761" { set +x $as_echo "$at_srcdir/calc.at:761: \$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:761" ( $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:761" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:761: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:761" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $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:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $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:761: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:761" ( $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:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $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:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $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:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:761: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:761" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:761: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:761: cat stderr" at_fn_check_prepare_trace "calc.at:761" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:761" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_421 #AT_START_422 at_fn_group_banner 422 'calc.at:762' \ "Calculator api.push-pull=both api.pure=full %locations " "" 15 at_xfail=no ( $as_echo "422. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); 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_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:762: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:762" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:762: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:762" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:762: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:762" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $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:762: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:762" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:762" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:762" { set +x $as_echo "$at_srcdir/calc.at:762: \$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:762" ( $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:762" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:762: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:762" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $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:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $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:762: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:762" ( $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:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $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:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $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:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:762: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:762" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:762: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:762: cat stderr" at_fn_check_prepare_trace "calc.at:762" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:762" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_422 #AT_START_423 at_fn_group_banner 423 'calc.at:763' \ "Calculator parse.error=verbose %locations " " " 15 at_xfail=no ( $as_echo "423. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define parse.error verbose %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (yylloc).first_column = (yylloc).last_column; (yylloc).first_line = (yylloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:763: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:763" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:763" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:763" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:763: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:763" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:763: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:763" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $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:763: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:763" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:763" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:763" { set +x $as_echo "$at_srcdir/calc.at:763: \$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:763" ( $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:763" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:763: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:763" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $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:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $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:763: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:763" ( $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:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $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:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $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:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:763: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:763" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:763: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:763: cat stderr" at_fn_check_prepare_trace "calc.at:763" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:763" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_423 #AT_START_424 at_fn_group_banner 424 'calc.at:765' \ "Calculator parse.error=verbose %locations %defines api.prefix={calc} %verbose %yacc " "" 15 at_xfail=no ( $as_echo "424. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define parse.error verbose %locations %defines %define api.prefix {calc} %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, CALCLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, CALCLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (const char *msg) { LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:765: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:765" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:765" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:765" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:765: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:765" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:765: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:765" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:765: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:765" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:765" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:765" { set +x $as_echo "$at_srcdir/calc.at:765: \$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:765" ( $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:765" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:765: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:765" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $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:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $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:765: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:765" ( $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:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $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:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $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:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:765: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:765" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:765: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:765: cat stderr" at_fn_check_prepare_trace "calc.at:765" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:765" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_424 #AT_START_425 at_fn_group_banner 425 'calc.at:766' \ "Calculator parse.error=verbose %locations %defines %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc " "" 15 at_xfail=no ( $as_echo "425. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define parse.error verbose %locations %defines %name-prefix "calc" %define api.token.prefix {TOK_} %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (const char *msg) { LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return TOK_NUM; } /* Return end-of-file. */ if (c == EOF) return TOK_CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:766: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:766" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:766" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:766" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:766: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:766" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:766: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:766" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $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:766: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:766" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:766" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:766" { set +x $as_echo "$at_srcdir/calc.at:766: \$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:766" ( $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:766" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:766: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:766" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $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:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $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:766: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:766" ( $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:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $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:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $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:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:766: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:766" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:766: cat stderr" at_fn_check_prepare_trace "calc.at:766" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:766" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_425 #AT_START_426 at_fn_group_banner 426 'calc.at:768' \ "Calculator %debug " " " 15 at_xfail=no ( $as_echo "426. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } yydebug = 1; status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:768: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:768" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:768" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:768" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:768: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:768" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:768: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:768" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $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:768: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:768" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:768" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:768" { set +x $as_echo "$at_srcdir/calc.at:768: \$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:768" ( $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:768" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:768: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:768" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $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:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $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:768: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:768" ( $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:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $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:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $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:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:768: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:768" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:768: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:768: cat stderr" at_fn_check_prepare_trace "calc.at:768" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:768" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_426 #AT_START_427 at_fn_group_banner 427 'calc.at:769' \ "Calculator parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc " "" 15 at_xfail=no ( $as_echo "427. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (const char *msg) { LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:769: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:769" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:769" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:769" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:769: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:769" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:769: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:769" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:769: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:769" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:769" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:769" { set +x $as_echo "$at_srcdir/calc.at:769: \$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:769" ( $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:769" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:769: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:769" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $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:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $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:769: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:769" ( $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:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $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:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $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:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:769: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:769" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:769: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:769: cat stderr" at_fn_check_prepare_trace "calc.at:769" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:769" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_427 #AT_START_428 at_fn_group_banner 428 'calc.at:770' \ "Calculator parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc " "" 15 at_xfail=no ( $as_echo "428. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, CALCLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, CALCLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (const char *msg) { LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:770: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:770" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:770" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:770" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:770: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:770" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:770: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:770" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $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:770: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:770" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:770" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:770" { set +x $as_echo "$at_srcdir/calc.at:770: \$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:770" ( $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:770" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:770: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:770" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $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:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $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:770: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:770" ( $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:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $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:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $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:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:770: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:770" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:770: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:770: cat stderr" at_fn_check_prepare_trace "calc.at:770" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:770" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_428 #AT_START_429 at_fn_group_banner 429 'calc.at:772' \ "Calculator api.pure=full parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc " "" 15 at_xfail=no ( $as_echo "429. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define api.pure full %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (YYLTYPE const * const llocp, const char *msg); int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); 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_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:772" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:772: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:772" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:772: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:772" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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/calc.at:772: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:772" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:772" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:772" { set +x $as_echo "$at_srcdir/calc.at:772: \$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:772" ( $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:772" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:772: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:772" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $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:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $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:772: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:772" ( $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:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $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:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $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:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:772: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:772" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:772: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:772: cat stderr" at_fn_check_prepare_trace "calc.at:772" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:772" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_429 #AT_START_430 at_fn_group_banner 430 'calc.at:773' \ "Calculator api.push-pull=both api.pure=full parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc " "" 15 at_xfail=no ( $as_echo "430. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define api.push-pull both %define api.pure full %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, CALCLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (CALCLTYPE const * const llocp, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, CALCLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (CALCLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); 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_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:773: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:773" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:773" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:773" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:773: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:773" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:773: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:773" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $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:773: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:773" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:773" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:773" { set +x $as_echo "$at_srcdir/calc.at:773: \$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:773" ( $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:773" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:773: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:773" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $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:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $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:773: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:773" ( $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:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $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:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $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:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:773: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:773" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:773: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:773: cat stderr" at_fn_check_prepare_trace "calc.at:773" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:773" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_430 #AT_START_431 at_fn_group_banner 431 'calc.at:775' \ "Calculator api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 15 at_xfail=no ( $as_echo "431. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, CALCLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, CALCLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { YYUSE(result); YYUSE(count); LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); 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_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:775: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:775" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:775" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:775" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:775: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:775" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:775: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:775" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $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:775: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:775" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:775" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:775" { set +x $as_echo "$at_srcdir/calc.at:775: \$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:775" ( $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:775" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:775: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:775" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $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:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $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:775: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:775" ( $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:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $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:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $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:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:775: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:775" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:775: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:775: cat stderr" at_fn_check_prepare_trace "calc.at:775" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:775" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_431 #AT_START_432 at_fn_group_banner 432 'calc.at:777' \ "Calculator %no-lines api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 15 at_xfail=no ( $as_echo "432. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %no-lines %define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, CALCLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, CALCLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { YYUSE(result); YYUSE(count); LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); 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_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:777: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:777" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:777" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:777" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:777: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:777" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:777: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:777" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $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:777: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:777" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:777" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:777" { set +x $as_echo "$at_srcdir/calc.at:777: \$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:777" ( $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:777" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:777: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:777" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $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:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $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:777: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:777" ( $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:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $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:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $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:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:777: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:777" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:777: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:777: cat stderr" at_fn_check_prepare_trace "calc.at:777" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:777" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_432 #AT_START_433 at_fn_group_banner 433 'calc.at:793' \ "Calculator %glr-parser " " " 16 at_xfail=no ( $as_echo "433. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:793: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:793" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:793" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:793" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:793: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:793" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:793: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:793" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $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:793: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:793" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:793" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:793" { set +x $as_echo "$at_srcdir/calc.at:793: \$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:793" ( $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:793" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:793: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:793" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $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:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $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:793: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:793" ( $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:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $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:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $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:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:793: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:793" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:793: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:793: cat stderr" at_fn_check_prepare_trace "calc.at:793" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:793" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_433 #AT_START_434 at_fn_group_banner 434 'calc.at:795' \ "Calculator %glr-parser %defines " " " 16 at_xfail=no ( $as_echo "434. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:795: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:795" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:795" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:795" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:795: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:795" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:795: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:795" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $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:795: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:795" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:795" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:795" { set +x $as_echo "$at_srcdir/calc.at:795: \$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:795" ( $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:795" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:795: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:795" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $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:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $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:795: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:795" ( $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:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $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:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $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:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:795: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:795" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:795: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:795: cat stderr" at_fn_check_prepare_trace "calc.at:795" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:795" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_434 #AT_START_435 at_fn_group_banner 435 'calc.at:796' \ "Calculator %glr-parser %locations " " " 16 at_xfail=no ( $as_echo "435. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (yylloc).first_column = (yylloc).last_column; (yylloc).first_line = (yylloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:796: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:796" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:796" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:796" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:796: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:796" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:796: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:796" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $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:796: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:796" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:796" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:796" { set +x $as_echo "$at_srcdir/calc.at:796: \$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:796" ( $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:796" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:796: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:796" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $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:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $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:796: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:796" ( $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:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $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:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $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:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:796: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:796" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:796: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:796: cat stderr" at_fn_check_prepare_trace "calc.at:796" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:796" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_435 #AT_START_436 at_fn_group_banner 436 'calc.at:797' \ "Calculator %glr-parser %locations api.location.type={Span} " "" 16 at_xfail=no ( $as_echo "436. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %locations %define api.location.type {Span} %code requires { typedef struct { int l; int c; } Point; typedef struct { Point first; Point last; } Span; # 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 (0) #include void location_print (FILE *o, Span s); #define LOCATION_PRINT location_print /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); int yylex (void); } %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } void location_print (FILE *o, Span s) { fprintf (o, "%d.%d", s.first.l, s.first.c); if (s.first.l != s.last.l) fprintf (o, "-%d.%d", s.last.l, s.last.c - 1); else if (s.first.c != s.last.c - 1) fprintf (o, "-%d", s.last.c - 1); } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); static YYLTYPE last_yylloc; static int get_char (void) { int res = getc (input); ; last_yylloc = (yylloc); if (res == '\n') { (yylloc).last.l++; (yylloc).last.c = 1; } else (yylloc).last.c++; return res; } static void unget_char ( int c) { ; /* Wrong when C == '\n'. */ (yylloc) = last_yylloc; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (yylloc).first.c = (yylloc).last.c; (yylloc).first.l = (yylloc).last.l; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:797: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:797" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:797" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:797" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:797: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:797" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:797: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:797" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $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:797: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:797" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:797" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:797" { set +x $as_echo "$at_srcdir/calc.at:797: \$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:797" ( $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:797" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:797: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:797" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $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:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $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:797: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:797" ( $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:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $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:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $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:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:797: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:797" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:797: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:797: cat stderr" at_fn_check_prepare_trace "calc.at:797" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:797" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_436 #AT_START_437 at_fn_group_banner 437 'calc.at:798' \ "Calculator %glr-parser %name-prefix \"calc\" " " " 16 at_xfail=no ( $as_echo "437. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void calcerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int calclex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:798: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:798" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:798" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:798" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:798: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:798" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:798: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:798" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $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:798: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:798" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:798" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:798" { set +x $as_echo "$at_srcdir/calc.at:798: \$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:798" ( $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:798" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:798: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:798" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $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:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $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:798: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:798" ( $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:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $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:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $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:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:798: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:798" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:798: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:798: cat stderr" at_fn_check_prepare_trace "calc.at:798" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:798" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_437 #AT_START_438 at_fn_group_banner 438 'calc.at:799' \ "Calculator %glr-parser api.prefix={calc} " " " 16 at_xfail=no ( $as_echo "438. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void calcerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int calclex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:799: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:799" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:799" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:799" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:799: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:799" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:799: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:799" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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/calc.at:799: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:799" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:799" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:799" { set +x $as_echo "$at_srcdir/calc.at:799: \$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:799" ( $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:799" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:799: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:799" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $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:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $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:799: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:799" ( $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:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $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:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $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:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:799: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:799" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:799: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:799: cat stderr" at_fn_check_prepare_trace "calc.at:799" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:799" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_438 #AT_START_439 at_fn_group_banner 439 'calc.at:800' \ "Calculator %glr-parser %verbose " " " 16 at_xfail=no ( $as_echo "439. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:800: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:800" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:800" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:800" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:800: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:800" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:800: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:800" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $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:800: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:800" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:800" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:800" { set +x $as_echo "$at_srcdir/calc.at:800: \$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:800" ( $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:800" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:800: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:800" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $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:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $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:800: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:800" ( $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:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $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:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $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:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:800: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:800" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:800: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:800: cat stderr" at_fn_check_prepare_trace "calc.at:800" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:800" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_439 #AT_START_440 at_fn_group_banner 440 'calc.at:801' \ "Calculator %glr-parser %yacc " " " 16 at_xfail=no ( $as_echo "440. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:801" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:801: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:801" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:801" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:801" { set +x $as_echo "$at_srcdir/calc.at:801: \$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:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:801: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:801" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $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:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $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:801: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $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:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $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:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:801: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:801" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:801: cat stderr" at_fn_check_prepare_trace "calc.at:801" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:801" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_440 #AT_START_441 at_fn_group_banner 441 'calc.at:802' \ "Calculator %glr-parser parse.error=verbose " " " 16 at_xfail=no ( $as_echo "441. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %define parse.error verbose %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:802: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:802" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:802" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:802" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:802: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:802" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:802: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:802" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $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:802: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:802" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:802" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:802" { set +x $as_echo "$at_srcdir/calc.at:802: \$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:802" ( $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:802" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:802: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:802" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $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:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $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:802: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:802" ( $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:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $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:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $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:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:802: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:802" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:802: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:802: cat stderr" at_fn_check_prepare_trace "calc.at:802" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:802" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_441 #AT_START_442 at_fn_group_banner 442 'calc.at:804' \ "Calculator %glr-parser api.pure %locations " " " 16 at_xfail=no ( $as_echo "442. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); 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_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:804: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:804" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:804" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:804" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:804: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:804" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:804: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:804" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $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:804: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:804" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:804" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:804" { set +x $as_echo "$at_srcdir/calc.at:804: \$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:804" ( $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:804" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:804: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:804" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $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:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $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:804: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:804" ( $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:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $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:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $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:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:804: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:804" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:804: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:804" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:804: cat stderr" at_fn_check_prepare_trace "calc.at:804" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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_442 #AT_START_443 at_fn_group_banner 443 'calc.at:805' \ "Calculator %glr-parser parse.error=verbose %locations " "" 16 at_xfail=no ( $as_echo "443. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %define parse.error verbose %locations %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); int yylex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include int yylex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (yylloc).first_column = (yylloc).last_column; (yylloc).first_line = (yylloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:805: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:805" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:805" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:805" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:805: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:805" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:805: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:805" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $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:805: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:805" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:805" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:805" { set +x $as_echo "$at_srcdir/calc.at:805: \$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:805" ( $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:805" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:805: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:805" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $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:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $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:805: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:805" ( $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:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $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:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $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:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:805: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:805" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:805: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:805: cat stderr" at_fn_check_prepare_trace "calc.at:805" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:805" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_443 #AT_START_444 at_fn_group_banner 444 'calc.at:807' \ "Calculator %glr-parser parse.error=verbose %locations %defines %name-prefix \"calc\" %verbose %yacc " "" 16 at_xfail=no ( $as_echo "444. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %define parse.error verbose %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (const char *msg) { LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:807: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:807" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:807" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:807" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:807: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:807" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:807: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:807" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $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:807: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:807" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:807" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:807" { set +x $as_echo "$at_srcdir/calc.at:807: \$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:807" ( $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:807" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:807: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:807" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $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:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $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:807: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:807" ( $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:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $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:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $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:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:807: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:807" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:807: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:807: cat stderr" at_fn_check_prepare_trace "calc.at:807" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:807" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_444 #AT_START_445 at_fn_group_banner 445 'calc.at:809' \ "Calculator %glr-parser %debug " " " 16 at_xfail=no ( $as_echo "445. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 (yyo, "%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); #include 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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include int yylex (void); static int get_char (void) { int res = getc (input); ; return res; } static void unget_char ( int c) { ; ungetc (c, input); } static int read_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (yylval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } yydebug = 1; status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:809: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:809" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:809" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:809" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:809: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:809" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:809: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:809" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $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:809: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:809" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:809" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:809" { set +x $as_echo "$at_srcdir/calc.at:809: \$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:809" ( $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:809" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:809: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:809" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $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:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $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:809: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:809" ( $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:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $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:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $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:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:809: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:809" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:809: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:809: cat stderr" at_fn_check_prepare_trace "calc.at:809" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:809" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_445 #AT_START_446 at_fn_group_banner 446 'calc.at:810' \ "Calculator %glr-parser parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc " "" 16 at_xfail=no ( $as_echo "446. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (const char *msg) { LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:810: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:810" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:810" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:810" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:810: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:810" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:810: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:810" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $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:810: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:810" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:810" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:810" { set +x $as_echo "$at_srcdir/calc.at:810: \$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:810" ( $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:810" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:810: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:810" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $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:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $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:810: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:810" ( $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:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $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:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $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:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:810: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:810" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:810: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:810: cat stderr" at_fn_check_prepare_trace "calc.at:810" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:810" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_446 #AT_START_447 at_fn_group_banner 447 'calc.at:811' \ "Calculator %glr-parser parse.error=verbose %debug %locations %defines api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc " "" 16 at_xfail=no ( $as_echo "447. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %define api.token.prefix {TOK_} %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, CALCLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (const char *msg); int calclex (void); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, CALCLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (const char *msg) { LOCATION_PRINT (stderr, (calclloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (void); 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_integer (void) { int c = get_char (); int res = 0; ; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (); } unget_char ( c); return res; } /*---------------------------------------------------------------. | 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 white spaces. */ do { (calclloc).first_column = (calclloc).last_column; (calclloc).first_line = (calclloc).last_line; } while ((c = get_char ()) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char ( c); (calclval).ival = read_integer (); return TOK_NUM; } /* Return end-of-file. */ if (c == EOF) return TOK_CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:811: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:811" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:811" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:811" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:811: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:811" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:811: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:811" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:811: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:811" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:811" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:811" { set +x $as_echo "$at_srcdir/calc.at:811: \$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:811" ( $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:811" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:811: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:811" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $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:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $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:811: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:811" ( $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:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $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:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $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:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:811: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:811" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:811: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:811: cat stderr" at_fn_check_prepare_trace "calc.at:811" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:811" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_447 #AT_START_448 at_fn_group_banner 448 'calc.at:813' \ "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc " "" 16 at_xfail=no ( $as_echo "448. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (YYLTYPE const * const llocp, const char *msg); int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); 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_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:813: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:813" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:813" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:813" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:813: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:813" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:813: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:813" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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/calc.at:813: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:813" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:813" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:813" { set +x $as_echo "$at_srcdir/calc.at:813: \$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:813" ( $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:813" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:813: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:813" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $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:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $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:813: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:813" ( $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:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $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:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $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:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:813: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:813" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:813: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:813: cat stderr" at_fn_check_prepare_trace "calc.at:813" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:813" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_448 #AT_START_449 at_fn_group_banner 449 'calc.at:815' \ "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 16 at_xfail=no ( $as_echo "449. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { YYUSE(result); YYUSE(count); LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (YYSTYPE *lvalp, YYLTYPE *llocp); 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_integer (YYSTYPE *lvalp, YYLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:815: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:815" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:815" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:815" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:815: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:815" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:815: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:815" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $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:815: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:815" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:815" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:815" { set +x $as_echo "$at_srcdir/calc.at:815: \$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:815" ( $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:815" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:815: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:815" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $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:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $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:815: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:815" ( $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:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $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:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $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:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:815: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:815" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:815: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:815: cat stderr" at_fn_check_prepare_trace "calc.at:815" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:815" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_449 #AT_START_450 at_fn_group_banner 450 'calc.at:816' \ "Calculator %glr-parser api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 16 at_xfail=no ( $as_echo "450. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, CALCLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, CALCLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { YYUSE(result); YYUSE(count); LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); 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_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:816: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:816" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:816" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:816" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:816: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:816" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:816: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:816" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $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:816: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:816" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:816" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:816" { set +x $as_echo "$at_srcdir/calc.at:816: \$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:816" ( $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:816" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:816: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:816" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $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:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $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:816: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:816" ( $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:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $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:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $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:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:816: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:816" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:816: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:816: cat stderr" at_fn_check_prepare_trace "calc.at:816" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:816" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_450 #AT_START_451 at_fn_group_banner 451 'calc.at:818' \ "Calculator %glr-parser %no-lines api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 16 at_xfail=no ( $as_echo "451. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %glr-parser %no-lines %define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%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); #include #if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, CALCLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg); int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } # if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, CALCLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, const char *msg) { YYUSE(result); YYUSE(count); LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } _ATEOF cat >calc-lex.c <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp); 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_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.h" #include #include semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } calcdebug = 1; status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:818: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:818" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:818" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:818" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:818: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:818" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:818: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:818" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $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:818: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:818" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:818" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:818" { set +x $as_echo "$at_srcdir/calc.at:818: \$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:818" ( $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:818" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:818: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.c calc.h " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:818" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.c calc.h ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $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:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $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:818: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:818" ( $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:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $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:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $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:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:818: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:818" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:818: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.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 stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:818" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:818: cat stderr" at_fn_check_prepare_trace "calc.at:818" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.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_451 #AT_START_452 at_fn_group_banner 452 'calc.at:828' \ "Calculator lalr1.cc %defines " " " 17 at_xfail=no ( $as_echo "452. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %skeleton "lalr1.cc" %defines %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp); static int get_char (yy::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (yy::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (yy::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:828: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:828" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:828" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:828" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:828: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:828" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:828: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:828" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $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:828: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:828" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:828" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:828" { set +x $as_echo "$at_srcdir/calc.at:828: \$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:828" ( $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:828" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:828: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:828" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $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:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $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:828: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:828" ( $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:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $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:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $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:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:828: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:828" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:828: cat stderr" at_fn_check_prepare_trace "calc.at:828" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:828" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_452 #AT_START_453 at_fn_group_banner 453 'calc.at:837' \ "Calculator C++ " " " 17 at_xfail=no ( $as_echo "453. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp); static int get_char (yy::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (yy::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (yy::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:837: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:837" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:837" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:837" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:837: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:837" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:837: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:837" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $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:837: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:837" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:837" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:837" { set +x $as_echo "$at_srcdir/calc.at:837: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:837" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:837: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:837" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $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:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $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:837: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:837" ( $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:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $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:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $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:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:837: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:837" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:837: cat stderr" at_fn_check_prepare_trace "calc.at:837" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:837" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_453 #AT_START_454 at_fn_group_banner 454 'calc.at:838' \ "Calculator C++ %locations " " " 17 at_xfail=no ( $as_echo "454. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %locations %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); 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_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:838: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:838" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:838" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:838" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:838: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:838" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:838: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:838" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $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:838: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:838" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:838" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:838" { set +x $as_echo "$at_srcdir/calc.at:838: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:838" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:838: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:838" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $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:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $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:838: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:838" ( $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:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $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:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $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:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:838: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:838" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:838: cat stderr" at_fn_check_prepare_trace "calc.at:838" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:838" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_454 #AT_START_455 at_fn_group_banner 455 'calc.at:839' \ "Calculator C++ %locations \$NO_EXCEPTIONS_CXXFLAGS" "" 17 at_xfail=no ( $as_echo "455. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %locations %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); 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_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:839: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:839" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:839" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:839" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:839: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:839" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:839: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:839" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $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:839: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:839" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:839" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:839" { set +x $as_echo "$at_srcdir/calc.at:839: \$CXX \$CXXFLAGS \$CPPFLAGS \$NO_EXCEPTIONS_CXXFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $NO_EXCEPTIONS_CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:839" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $NO_EXCEPTIONS_CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:839: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:839" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $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:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $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:839: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:839" ( $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:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $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:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $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:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:839: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:839" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:839: cat stderr" at_fn_check_prepare_trace "calc.at:839" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:839" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_455 #AT_START_456 at_fn_group_banner 456 'calc.at:840' \ "Calculator C++ %locations api.location.type={Span} " "" 17 at_xfail=no ( $as_echo "456. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %locations %define api.location.type {Span} %define global_tokens_and_yystype %code requires { typedef struct { int l; int c; } Point; typedef struct { Point first; Point last; } Span; # 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 (0) /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include namespace { std::ostream& operator<< (std::ostream& o, const Span& s) { o << s.first.l << '.' << s.first.c; if (s.first.l != s.last.l) o << '-' << s.last.l << '.' << s.last.c - 1; else if (s.first.c != s.last.c - 1) o << '-' << s.last.c - 1; return o; } } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); 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_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:840: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:840" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:840" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:840" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:840: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:840" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:840: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:840" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $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:840: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:840" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:840" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:840" { set +x $as_echo "$at_srcdir/calc.at:840: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:840" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:840: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:840" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $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:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $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:840: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:840" ( $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:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $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:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $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:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:840: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:840" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:840: cat stderr" at_fn_check_prepare_trace "calc.at:840" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:840" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_456 #AT_START_457 at_fn_group_banner 457 'calc.at:841' \ "Calculator C++ %defines %locations parse.error=verbose %name-prefix \"calc\" %verbose %yacc " "" 17 at_xfail=no ( $as_echo "457. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %defines %locations %define parse.error verbose %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:841: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:841" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:841" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:841" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:841: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:841" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:841: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:841" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $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:841: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:841" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:841" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:841" { set +x $as_echo "$at_srcdir/calc.at:841: \$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:841" ( $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:841" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:841: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:841" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $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:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $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:841: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:841" ( $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:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $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:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $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:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:841: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:841" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:841: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:841: cat stderr" at_fn_check_prepare_trace "calc.at:841" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:841" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_457 #AT_START_458 at_fn_group_banner 458 'calc.at:843' \ "Calculator C++ %locations parse.error=verbose api.prefix={calc} %verbose %yacc " "" 17 at_xfail=no ( $as_echo "458. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %locations %define parse.error verbose %define api.prefix {calc} %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:843: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:843" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:843" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:843" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:843: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:843" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:843: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:843" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $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:843: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:843" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:843" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:843" { set +x $as_echo "$at_srcdir/calc.at:843: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:843" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:843: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:843" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $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:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $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:843: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:843" ( $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:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $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:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $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:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:843: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:843" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:843: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:843: cat stderr" at_fn_check_prepare_trace "calc.at:843" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:843" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_458 #AT_START_459 at_fn_group_banner 459 'calc.at:844' \ "Calculator C++ %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc " "" 17 at_xfail=no ( $as_echo "459. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %locations %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:844: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:844" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:844" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:844" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:844: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:844" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:844: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:844" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $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:844: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:844" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:844" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:844" { set +x $as_echo "$at_srcdir/calc.at:844: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:844" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:844: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:844" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $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:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $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:844: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:844" ( $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:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $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:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $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:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:844: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:844" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:844: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:844: cat stderr" at_fn_check_prepare_trace "calc.at:844" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:844" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_459 #AT_START_460 at_fn_group_banner 460 'calc.at:846' \ "Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc " "" 17 at_xfail=no ( $as_echo "460. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %locations %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:846: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:846" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:846" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:846" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:846: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:846" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:846: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:846" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $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:846: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:846" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:846" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:846" { set +x $as_echo "$at_srcdir/calc.at:846: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:846" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:846: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:846" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $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:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $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:846: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:846" ( $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:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $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:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $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:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:846: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:846" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:846: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:846: cat stderr" at_fn_check_prepare_trace "calc.at:846" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:846" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_460 #AT_START_461 at_fn_group_banner 461 'calc.at:847' \ "Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} api.token.prefix={TOK_} %verbose %yacc " "" 17 at_xfail=no ( $as_echo "461. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %locations %define parse.error verbose %debug %define api.prefix {calc} %define api.token.prefix {TOK_} %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return TOK_NUM; } /* Return end-of-file. */ if (c == EOF) return TOK_CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:847: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:847" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:847" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:847" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:847: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:847" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:847: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:847" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $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:847: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:847" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:847" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:847" { set +x $as_echo "$at_srcdir/calc.at:847: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:847" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:847: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:847" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $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:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $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:847: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:847" ( $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:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $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:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $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:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:847: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:847" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:847: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:847: cat stderr" at_fn_check_prepare_trace "calc.at:847" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:847" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_461 #AT_START_462 at_fn_group_banner 462 'calc.at:849' \ "Calculator C++ %defines %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 17 at_xfail=no ( $as_echo "462. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %defines %locations %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:849: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:849" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:849" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:849" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:849: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:849" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:849: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:849" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $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:849: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:849" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:849" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:849" { set +x $as_echo "$at_srcdir/calc.at:849: \$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:849" ( $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:849" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:849: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:849" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $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:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $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:849: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:849" ( $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:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $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:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $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:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:849: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:849" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:849: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:849: cat stderr" at_fn_check_prepare_trace "calc.at:849" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:849" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_462 #AT_START_463 at_fn_group_banner 463 'calc.at:851' \ "Calculator C++ parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 17 at_xfail=no ( $as_echo "463. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include int calclex (calc::parser::semantic_type *lvalp); static int get_char (calc::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (calc::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (calc::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:851: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:851" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:851" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:851" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:851: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:851" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:851: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:851" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:851: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:851" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:851" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:851" { set +x $as_echo "$at_srcdir/calc.at:851: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:851" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:851: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:851" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $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:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $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:851: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:851" ( $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:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $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:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $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:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:851: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:851" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:851: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:851: cat stderr" at_fn_check_prepare_trace "calc.at:851" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:851" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_463 #AT_START_464 at_fn_group_banner 464 'calc.at:852' \ "Calculator C++ %defines %locations parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 17 at_xfail=no ( $as_echo "464. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %defines %locations %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:852: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:852" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:852" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:852" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:852: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:852" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:852: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:852" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $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:852: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:852" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:852" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:852" { set +x $as_echo "$at_srcdir/calc.at:852: \$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:852" ( $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:852" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:852: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:852" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $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:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $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:852: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:852" ( $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:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $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:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $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:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:852: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:852" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:852: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:852: cat stderr" at_fn_check_prepare_trace "calc.at:852" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:852" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_464 #AT_START_465 at_fn_group_banner 465 'calc.at:854' \ "Calculator C++ %defines %locations api.location.file=none " "" 17 at_xfail=no ( $as_echo "465. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %defines %locations %define api.location.file none %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); 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_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:854: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:854" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:854" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:854" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:854: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:854" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:854: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:854" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:854: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:854" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:854" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:854" { set +x $as_echo "$at_srcdir/calc.at:854: \$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:854" ( $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:854" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:854: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:854" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $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:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $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:854: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:854" ( $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:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $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:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $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:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:854: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:854" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:854: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:854: cat stderr" at_fn_check_prepare_trace "calc.at:854" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:854" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_465 #AT_START_466 at_fn_group_banner 466 'calc.at:855' \ "Calculator C++ %defines %locations api.location.file=\"my-location.hh\" " "" 17 at_xfail=no ( $as_echo "466. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %defines %locations %define api.location.file "my-location.hh" %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); 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_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:855: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:855" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:855" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:855" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:855: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:855" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:855: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:855" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $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:855: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:855" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:855" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:855" { set +x $as_echo "$at_srcdir/calc.at:855: \$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:855" ( $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:855" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:855: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:855" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $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:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $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:855: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:855" ( $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:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $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:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $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:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:855: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:855" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:855: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:855: cat stderr" at_fn_check_prepare_trace "calc.at:855" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:855" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_466 #AT_START_467 at_fn_group_banner 467 'calc.at:857' \ "Calculator C++ %no-lines %defines %locations api.location.file=\"my-location.hh\" " "" 17 at_xfail=no ( $as_echo "467. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %no-lines %defines %locations %define api.location.file "my-location.hh" %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); 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_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:857: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:857" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:857" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:857" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:857: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:857" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:857: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:857" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:857: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:857" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:857" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:857" { set +x $as_echo "$at_srcdir/calc.at:857: \$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:857" ( $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:857" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:857: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:857" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $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:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $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:857: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:857" ( $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:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $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:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $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:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:857: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:857" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:857: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:857: cat stderr" at_fn_check_prepare_trace "calc.at:857" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:857" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_467 #AT_START_468 at_fn_group_banner 468 'calc.at:867' \ "Calculator glr.cc " " " 18 at_xfail=no ( $as_echo "468. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %skeleton "glr.cc" %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp); static int get_char (yy::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (yy::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (yy::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:867: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:867" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:867" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:867" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:867: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:867" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:867: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:867" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $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:867: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:867" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:867" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:867" { set +x $as_echo "$at_srcdir/calc.at:867: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:867" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:867: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:867" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $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:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $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:867: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:867" ( $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:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $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:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $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:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:867: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:867" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:867: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:867: cat stderr" at_fn_check_prepare_trace "calc.at:867" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:867" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_468 #AT_START_469 at_fn_group_banner 469 'calc.at:876' \ "Calculator C++ %glr-parser " " " 18 at_xfail=no ( $as_echo "469. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp); static int get_char (yy::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (yy::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (yy::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:876: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:876" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:876" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:876" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:876: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:876" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:876: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:876" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $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:876: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:876" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:876" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:876" { set +x $as_echo "$at_srcdir/calc.at:876: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:876" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:876: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:876" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $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:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $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:876: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:876" ( $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:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $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:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $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:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:876: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:876" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:876: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:876: cat stderr" at_fn_check_prepare_trace "calc.at:876" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:876" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_469 #AT_START_470 at_fn_group_banner 470 'calc.at:877' \ "Calculator C++ %glr-parser %locations " " " 18 at_xfail=no ( $as_echo "470. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %locations %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); 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_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:877: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:877" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:877" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:877" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:877: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:877" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:877: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:877" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/calc.at:877: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:877" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:877" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:877" { set +x $as_echo "$at_srcdir/calc.at:877: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:877" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:877: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:877" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $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:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $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:877: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:877" ( $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:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $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:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $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:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:877: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:877" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:877: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:877: cat stderr" at_fn_check_prepare_trace "calc.at:877" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:877" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_470 #AT_START_471 at_fn_group_banner 471 'calc.at:878' \ "Calculator C++ %glr-parser %locations api.location.type={Span} " "" 18 at_xfail=no ( $as_echo "471. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %locations %define api.location.type {Span} %define global_tokens_and_yystype %code requires { typedef struct { int l; int c; } Point; typedef struct { Point first; Point last; } Span; # 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 (0) /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } #include namespace { std::ostream& operator<< (std::ostream& o, const Span& s) { o << s.first.l << '.' << s.first.c; if (s.first.l != s.last.l) o << '-' << s.last.l << '.' << s.last.c - 1; else if (s.first.c != s.last.c - 1) o << '-' << s.last.c - 1; return o; } } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); 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_integer (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_integer (lvalp, llocp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:878: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:878" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:878" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:878" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:878: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:878" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:878: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:878" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $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:878: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:878" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:878" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:878" { set +x $as_echo "$at_srcdir/calc.at:878: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:878" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:878: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:878" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $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:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $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:878: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:878" ( $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:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $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:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $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:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:878: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:878" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:878: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:878: cat stderr" at_fn_check_prepare_trace "calc.at:878" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:878" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_471 #AT_START_472 at_fn_group_banner 472 'calc.at:879' \ "Calculator C++ %glr-parser %defines parse.error=verbose %name-prefix \"calc\" %verbose %yacc " "" 18 at_xfail=no ( $as_echo "472. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %defines %define parse.error verbose %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const std::string& m) { std::cerr << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp); static int get_char (calc::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (calc::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (calc::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } _ATEOF cat >calc-main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:879: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:879" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:879" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:879" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:879: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:879" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:879: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:879" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $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:879: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:879" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:879" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:879" { set +x $as_echo "$at_srcdir/calc.at:879: \$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:879" ( $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:879" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:879: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:879" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $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:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $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:879: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:879" ( $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:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $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:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $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:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:879: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:879" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:879: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:879: cat stderr" at_fn_check_prepare_trace "calc.at:879" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:879" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_472 #AT_START_473 at_fn_group_banner 473 'calc.at:880' \ "Calculator C++ %glr-parser parse.error=verbose api.prefix={calc} %verbose %yacc " "" 18 at_xfail=no ( $as_echo "473. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %define parse.error verbose %define api.prefix {calc} %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include int calclex (calc::parser::semantic_type *lvalp); static int get_char (calc::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (calc::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (calc::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:880: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:880" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:880" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:880" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:880: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:880" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:880: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:880" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $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:880: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:880" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:880" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:880" { set +x $as_echo "$at_srcdir/calc.at:880: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:880" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:880: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:880" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $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:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $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:880: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:880" ( $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:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $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:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $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:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:880: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:880" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:880: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:880: cat stderr" at_fn_check_prepare_trace "calc.at:880" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:880" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_473 #AT_START_474 at_fn_group_banner 474 'calc.at:882' \ "Calculator C++ %glr-parser %debug " " " 18 at_xfail=no ( $as_echo "474. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %debug %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include int yylex (yy::parser::semantic_type *lvalp); static int get_char (yy::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (yy::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (yy::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int yylex (yy::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ yyparse that simulates the C signature. */ int yyparse () { yy::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = yyparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:882: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:882" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:882" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:882" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:882: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:882" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:882: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:882" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $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:882: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:882" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:882" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:882" { set +x $as_echo "$at_srcdir/calc.at:882: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:882" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:882: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:882" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $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:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $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:882: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:882" ( $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:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $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:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $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:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:882: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:882" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:882: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:882: cat stderr" at_fn_check_prepare_trace "calc.at:882" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:882" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_474 #AT_START_475 at_fn_group_banner 475 'calc.at:884' \ "Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc " "" 18 at_xfail=no ( $as_echo "475. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include int calclex (calc::parser::semantic_type *lvalp); static int get_char (calc::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (calc::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (calc::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return NUM; } /* Return end-of-file. */ if (c == EOF) return CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:884: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:884" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:884" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:884" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:884: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:884" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:884: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:884" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $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:884: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:884" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:884" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:884" { set +x $as_echo "$at_srcdir/calc.at:884: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:884" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:884: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:884" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $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:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $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:884: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:884" ( $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:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $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:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $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:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:884: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:884" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:884: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:884: cat stderr" at_fn_check_prepare_trace "calc.at:884" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:884" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_475 #AT_START_476 at_fn_group_banner 476 'calc.at:885' \ "Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc " "" 18 at_xfail=no ( $as_echo "476. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %define parse.error verbose %debug %name-prefix "calc" %define api.token.prefix {TOK_} %verbose %yacc %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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); } /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { USE ($1); } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include int calclex (calc::parser::semantic_type *lvalp); static int get_char (calc::parser::semantic_type *lvalp) { int res = getc (input); (void) lvalp;; return res; } static void unget_char (calc::parser::semantic_type *lvalp, int c) { (void) lvalp;; ungetc (c, input); } static int read_integer (calc::parser::semantic_type *lvalp) { int c = get_char (lvalp); int res = 0; (void) lvalp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp); } unget_char (lvalp, c); return res; } /*---------------------------------------------------------------. | Lexical analyzer returns an integer on the stack and the token | | NUM, or the ASCII character read if not a number. Skips all | | blanks and tabs, returns 0 for EOF. | `---------------------------------------------------------------*/ int calclex (calc::parser::semantic_type *lvalp) { int c; /* Skip white spaces. */ do { } while ((c = get_char (lvalp)) == ' ' || c == '\t'); /* Process numbers. */ if (isdigit (c)) { unget_char (lvalp, c); (*lvalp).ival = read_integer (lvalp); return TOK_NUM; } /* Return end-of-file. */ if (c == EOF) return TOK_CALC_EOF; /* Return single chars. */ return c; } #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse () { calc::parser parser; #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:885: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:885" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:885" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:885" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:885: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:885" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:885: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:885" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $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:885: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:885" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:885" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:885" { set +x $as_echo "$at_srcdir/calc.at:885: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:885" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o calc calc.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:885: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:885" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $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:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $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:885: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:885" ( $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:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $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:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $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:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:885: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:885" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:885: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:885: cat stderr" at_fn_check_prepare_trace "calc.at:885" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:885" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_476 #AT_START_477 at_fn_group_banner 477 'calc.at:887' \ "Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug %name-prefix \"calc\" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 18 at_xfail=no ( $as_echo "477. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %locations %defines %define parse.error verbose %debug %name-prefix "calc" %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if YYDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:887: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:887" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:887" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:887" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:887: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:887" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:887: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:887" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $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:887: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:887" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:887" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:887" { set +x $as_echo "$at_srcdir/calc.at:887: \$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:887" ( $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:887" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:887: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:887" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $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:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $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:887: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:887" ( $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:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $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:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $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:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:887: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:887" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:887: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:887: cat stderr" at_fn_check_prepare_trace "calc.at:887" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:887" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_477 #AT_START_478 at_fn_group_banner 478 'calc.at:888' \ "Calculator C++ %glr-parser %locations %defines parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 18 at_xfail=no ( $as_echo "478. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %locations %defines %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:888: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:888" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:888" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:888" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:888: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:888" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:888: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:888" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $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:888: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:888" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:888" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:888" { set +x $as_echo "$at_srcdir/calc.at:888: \$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:888" ( $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:888" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:888: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:888" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $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:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $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:888: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:888" ( $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:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $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:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $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:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:888: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:888" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:888: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:888: cat stderr" at_fn_check_prepare_trace "calc.at:888" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:888" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_478 #AT_START_479 at_fn_group_banner 479 'calc.at:890' \ "Calculator C++ %glr-parser %no-lines %locations %defines parse.error=verbose %debug api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} " "" 18 at_xfail=no ( $as_echo "479. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Infix notation calculator--calc */ %language "C++" %glr-parser %no-lines %locations %defines %define parse.error verbose %debug %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result} %parse-param {int *count} %define global_tokens_and_yystype %code requires { /* Exercise pre-prologue dependency to %union. */ typedef int semantic_value; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { yyo << $$; } ; %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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { ++*count; ++global_count; } ; line: '\n' | exp '\n' { *result = global_result = $1; } ; exp: NUM | 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; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* A C++ error reporting function. */ void calc::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF cat >calc-lex.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include int calclex (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp); 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_integer (calc::parser::semantic_type *lvalp, calc::parser::location_type *llocp) { int c = get_char (lvalp, llocp); int res = 0; (void) lvalp;(void) llocp;; while (isdigit (c)) { res = 10 * res + (c - '0'); c = get_char (lvalp, llocp); } unget_char (lvalp, llocp, c); return res; } /*---------------------------------------------------------------. | 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 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 (isdigit (c)) { unget_char (lvalp, llocp, c); (*lvalp).ival = read_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' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "calc.hh" #include #include namespace { /* A C++ calcparse that simulates the C signature. */ int calcparse (semantic_value *result, int *count) { calc::parser parser (result, count); #if CALCDEBUG parser.set_debug_level (1); #endif return parser.parse (); } } semantic_value global_result = 0; int global_count = 0; /* A C main function. */ int main (int argc, const char **argv) { semantic_value result = 0; int count = 0; int status; /* This used to be alarm (10), but that isn't enough time for a July 1995 vintage DEC Alphastation 200 4/100 system, according to Nelson H. F. Beebe. 100 seconds was enough for regular users, but the Hydra build farm, which is heavily loaded needs more. */ alarm (200); if (argc == 2) input = fopen (argv[1], "r"); else input = stdin; if (!input) { perror (argv[1]); return 3; } status = calcparse (&result, &count); if (fclose (input)) perror ("fclose"); assert (global_result == result); (void) result; assert (global_count == count); (void) count; return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/calc.at:890: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:890" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:890" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:890" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:890: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:890" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:890: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:890" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $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:890: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:890" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:890" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:890" { set +x $as_echo "$at_srcdir/calc.at:890: \$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:890" ( $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:890" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:890: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.cc calc.hh " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:890" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.cc calc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $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:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $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:890: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:890" ( $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:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $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:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $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:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:890: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:890" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:890: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:890: cat stderr" at_fn_check_prepare_trace "calc.at:890" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:890" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_479 #AT_START_480 at_fn_group_banner 480 'calc.at:900' \ "Calculator lalr1.d " " " 19 at_xfail=no ( $as_echo "480. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %skeleton "lalr1.d" %code imports { alias semantic_value = int; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%d", $$); } ; /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { } ; exp: NUM | exp '=' exp { if ($1 != $3) stderr.writefln ("calc: error: %d != %d", $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; } | '!' { $$ = 0; return YYERROR; } | '-' error { $$ = 0; return YYERROR; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } import std.range.primitives; import std.stdio; auto calcLexer(R)(R range) if (isInputRange!R && is (ElementType!R : dchar)) { return new CalcLexer!R(range); } auto calcLexer (File f) { import std.algorithm : map, joiner; import std.utf : byDchar; return f.byChunk(1024) // avoid making a syscall roundtrip per char .map!(chunk => cast(char[]) chunk) // because byChunk returns ubyte[] .joiner // combine chunks into a single virtual range of char .calcLexer; // forward to other overload } class CalcLexer(R) : Lexer if (isInputRange!R && is (ElementType!R : dchar)) { R input; this(R r) { input = r; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } YYSemanticType semanticVal_; public final @property YYSemanticType semanticVal() { return semanticVal_; } int parseInt () { auto res = 0; import std.uni : isNumber; while (input.front.isNumber) { res = res * 10 + (input.front - '0'); input.popFront; } return res; } int yylex () { import std.uni : isWhite, isNumber; // Skip initial spaces while (!input.empty && input.front != '\n' && isWhite (input.front)) { input.popFront; } // Handle EOF. if (input.empty) return YYTokenType.EOF; // Numbers. if (input.front.isNumber) { semanticVal_.ival = parseInt; return YYTokenType.NUM; } // Individual characters auto c = input.front; input.popFront; return c; } } int main (string[] args) { semantic_value result = 0; int count = 0; File input = args.length == 2 ? File (args[1], "r") : stdin; auto l = calcLexer (input); auto p = new YYParser (l); 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/calc.at:900: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:900" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" "calc.at:900" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:900: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:900" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:900: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:900" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $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:900: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d 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:900" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:900" >"$at_check_line_file" (! $BISON_DC_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:900" { set +x $as_echo "$at_srcdir/calc.at:900: \$DC \$DCFLAGS -ofcalc calc.d" at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofcalc calc.d" "calc.at:900" ( $at_check_trace; $DC $DCFLAGS -ofcalc calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:900: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.d " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:900" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $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:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $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:900: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:900" ( $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:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $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:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $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:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:900: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:900" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:900: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:900: cat stderr" at_fn_check_prepare_trace "calc.at:900" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:900" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_480 #AT_START_481 at_fn_group_banner 481 'calc.at:909' \ "Calculator D " " " 19 at_xfail=no ( $as_echo "481. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "D" %code imports { alias semantic_value = int; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%d", $$); } ; /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { } ; exp: NUM | exp '=' exp { if ($1 != $3) stderr.writefln ("calc: error: %d != %d", $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; } | '!' { $$ = 0; return YYERROR; } | '-' error { $$ = 0; return YYERROR; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } import std.range.primitives; import std.stdio; auto calcLexer(R)(R range) if (isInputRange!R && is (ElementType!R : dchar)) { return new CalcLexer!R(range); } auto calcLexer (File f) { import std.algorithm : map, joiner; import std.utf : byDchar; return f.byChunk(1024) // avoid making a syscall roundtrip per char .map!(chunk => cast(char[]) chunk) // because byChunk returns ubyte[] .joiner // combine chunks into a single virtual range of char .calcLexer; // forward to other overload } class CalcLexer(R) : Lexer if (isInputRange!R && is (ElementType!R : dchar)) { R input; this(R r) { input = r; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } YYSemanticType semanticVal_; public final @property YYSemanticType semanticVal() { return semanticVal_; } int parseInt () { auto res = 0; import std.uni : isNumber; while (input.front.isNumber) { res = res * 10 + (input.front - '0'); input.popFront; } return res; } int yylex () { import std.uni : isWhite, isNumber; // Skip initial spaces while (!input.empty && input.front != '\n' && isWhite (input.front)) { input.popFront; } // Handle EOF. if (input.empty) return YYTokenType.EOF; // Numbers. if (input.front.isNumber) { semanticVal_.ival = parseInt; return YYTokenType.NUM; } // Individual characters auto c = input.front; input.popFront; return c; } } int main (string[] args) { semantic_value result = 0; int count = 0; File input = args.length == 2 ? File (args[1], "r") : stdin; auto l = calcLexer (input); auto p = new YYParser (l); 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/calc.at:909: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:909" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" "calc.at:909" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:909: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:909" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:909: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:909" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $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:909: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d 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:909" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:909" >"$at_check_line_file" (! $BISON_DC_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:909" { set +x $as_echo "$at_srcdir/calc.at:909: \$DC \$DCFLAGS -ofcalc calc.d" at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofcalc calc.d" "calc.at:909" ( $at_check_trace; $DC $DCFLAGS -ofcalc calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:909: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.d " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:909" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $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:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $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:909: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:909" ( $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:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $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:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $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:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:909: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:909" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:909: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:909: cat stderr" at_fn_check_prepare_trace "calc.at:909" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:909" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_481 #AT_START_482 at_fn_group_banner 482 'calc.at:910' \ "Calculator D %locations " " " 19 at_xfail=no ( $as_echo "482. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "D" %locations %code imports { alias semantic_value = int; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%d", $$); } ; /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { } ; exp: NUM | exp '=' exp { if ($1 != $3) stderr.writefln ("calc: error: %d != %d", $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; } | '!' { $$ = 0; return YYERROR; } | '-' error { $$ = 0; return YYERROR; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* An error reporting function. */ public void yyerror (YYLocation l, string m) { stderr.writeln (l, ": ", m); } import std.range.primitives; import std.stdio; auto calcLexer(R)(R range) if (isInputRange!R && is (ElementType!R : dchar)) { return new CalcLexer!R(range); } auto calcLexer (File f) { import std.algorithm : map, joiner; import std.utf : byDchar; return f.byChunk(1024) // avoid making a syscall roundtrip per char .map!(chunk => cast(char[]) chunk) // because byChunk returns ubyte[] .joiner // combine chunks into a single virtual range of char .calcLexer; // forward to other overload } class CalcLexer(R) : Lexer if (isInputRange!R && is (ElementType!R : dchar)) { R input; this(R r) { input = r; } /* An error reporting function. */ public void yyerror (YYLocation l, string m) { stderr.writeln (l, ": ", m); } YYSemanticType semanticVal_; YYLocation location = new YYLocation; public final @property YYPosition startPos() { return location.begin; } public final @property YYPosition endPos() { return location.end; } public final @property YYSemanticType semanticVal() { return semanticVal_; } int parseInt () { auto res = 0; import std.uni : isNumber; while (input.front.isNumber) { res = res * 10 + (input.front - '0'); location.end.column += 1; input.popFront; } return res; } int yylex () { location.begin = location.end; import std.uni : isWhite, isNumber; // Skip initial spaces while (!input.empty && input.front != '\n' && isWhite (input.front)) { input.popFront; location.begin.column += 1; location.end.column += 1; } // Handle EOF. if (input.empty) return YYTokenType.EOF; // Numbers. if (input.front.isNumber) { semanticVal_.ival = parseInt; return YYTokenType.NUM; } // Individual characters auto c = input.front; if (c == '\n') { location.end.line += 1; location.end.column = 1; } else location.end.column += 1; input.popFront; return c; } } int main (string[] args) { semantic_value result = 0; int count = 0; File input = args.length == 2 ? File (args[1], "r") : stdin; auto l = calcLexer (input); auto p = new YYParser (l); 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/calc.at:910: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:910" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" "calc.at:910" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:910: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:910" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:910: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:910" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $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:910: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d 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:910" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:910" >"$at_check_line_file" (! $BISON_DC_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:910" { set +x $as_echo "$at_srcdir/calc.at:910: \$DC \$DCFLAGS -ofcalc calc.d" at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofcalc calc.d" "calc.at:910" ( $at_check_trace; $DC $DCFLAGS -ofcalc calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:910: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.d " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:910" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $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:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $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:910: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:910" ( $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:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $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:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $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:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:910: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:910" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:910: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:910: cat stderr" at_fn_check_prepare_trace "calc.at:910" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:910" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_482 #AT_START_483 at_fn_group_banner 483 'calc.at:912' \ "Calculator D parse.error=verbose api.prefix={calc} %verbose " "" 19 at_xfail=no ( $as_echo "483. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "D" %define parse.error verbose %define api.prefix {calc} %verbose %code imports { alias semantic_value = int; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%d", $$); } ; /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { } ; exp: NUM | exp '=' exp { if ($1 != $3) stderr.writefln ("calc: error: %d != %d", $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; } | '!' { $$ = 0; return YYERROR; } | '-' error { $$ = 0; return YYERROR; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } import std.range.primitives; import std.stdio; auto calcLexer(R)(R range) if (isInputRange!R && is (ElementType!R : dchar)) { return new CalcLexer!R(range); } auto calcLexer (File f) { import std.algorithm : map, joiner; import std.utf : byDchar; return f.byChunk(1024) // avoid making a syscall roundtrip per char .map!(chunk => cast(char[]) chunk) // because byChunk returns ubyte[] .joiner // combine chunks into a single virtual range of char .calcLexer; // forward to other overload } class CalcLexer(R) : Lexer if (isInputRange!R && is (ElementType!R : dchar)) { R input; this(R r) { input = r; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } YYSemanticType semanticVal_; public final @property YYSemanticType semanticVal() { return semanticVal_; } int parseInt () { auto res = 0; import std.uni : isNumber; while (input.front.isNumber) { res = res * 10 + (input.front - '0'); input.popFront; } return res; } int yylex () { import std.uni : isWhite, isNumber; // Skip initial spaces while (!input.empty && input.front != '\n' && isWhite (input.front)) { input.popFront; } // Handle EOF. if (input.empty) return YYTokenType.EOF; // Numbers. if (input.front.isNumber) { semanticVal_.ival = parseInt; return YYTokenType.NUM; } // Individual characters auto c = input.front; input.popFront; return c; } } int main (string[] args) { semantic_value result = 0; int count = 0; File input = args.length == 2 ? File (args[1], "r") : stdin; auto l = calcLexer (input); auto p = new YYParser (l); 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/calc.at:912: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:912" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" "calc.at:912" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:912: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:912" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:912: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:912" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $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:912: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d 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:912" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:912" >"$at_check_line_file" (! $BISON_DC_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:912" { set +x $as_echo "$at_srcdir/calc.at:912: \$DC \$DCFLAGS -ofcalc calc.d" at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofcalc calc.d" "calc.at:912" ( $at_check_trace; $DC $DCFLAGS -ofcalc calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:912: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.d " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:912" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $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:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $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:912: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:912" ( $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:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $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:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $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:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:912: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:912" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:912: cat stderr" at_fn_check_prepare_trace "calc.at:912" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:912" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_483 #AT_START_484 at_fn_group_banner 484 'calc.at:914' \ "Calculator D %debug " " " 19 at_xfail=no ( $as_echo "484. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "D" %debug %code imports { alias semantic_value = int; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%d", $$); } ; /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { } ; exp: NUM | exp '=' exp { if ($1 != $3) stderr.writefln ("calc: error: %d != %d", $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; } | '!' { $$ = 0; return YYERROR; } | '-' error { $$ = 0; return YYERROR; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } import std.range.primitives; import std.stdio; auto calcLexer(R)(R range) if (isInputRange!R && is (ElementType!R : dchar)) { return new CalcLexer!R(range); } auto calcLexer (File f) { import std.algorithm : map, joiner; import std.utf : byDchar; return f.byChunk(1024) // avoid making a syscall roundtrip per char .map!(chunk => cast(char[]) chunk) // because byChunk returns ubyte[] .joiner // combine chunks into a single virtual range of char .calcLexer; // forward to other overload } class CalcLexer(R) : Lexer if (isInputRange!R && is (ElementType!R : dchar)) { R input; this(R r) { input = r; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } YYSemanticType semanticVal_; public final @property YYSemanticType semanticVal() { return semanticVal_; } int parseInt () { auto res = 0; import std.uni : isNumber; while (input.front.isNumber) { res = res * 10 + (input.front - '0'); input.popFront; } return res; } int yylex () { import std.uni : isWhite, isNumber; // Skip initial spaces while (!input.empty && input.front != '\n' && isWhite (input.front)) { input.popFront; } // Handle EOF. if (input.empty) return YYTokenType.EOF; // Numbers. if (input.front.isNumber) { semanticVal_.ival = parseInt; return YYTokenType.NUM; } // Individual characters auto c = input.front; input.popFront; return c; } } int main (string[] args) { semantic_value result = 0; int count = 0; File input = args.length == 2 ? File (args[1], "r") : stdin; auto l = calcLexer (input); auto p = new YYParser (l); 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/calc.at:914: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:914" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" "calc.at:914" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:914: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:914" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:914: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:914" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $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:914: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d 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:914" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:914" >"$at_check_line_file" (! $BISON_DC_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:914" { set +x $as_echo "$at_srcdir/calc.at:914: \$DC \$DCFLAGS -ofcalc calc.d" at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofcalc calc.d" "calc.at:914" ( $at_check_trace; $DC $DCFLAGS -ofcalc calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:914: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.d " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:914" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $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:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $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:914: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:914" ( $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:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $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:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $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:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:914: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:914" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:914: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:914: cat stderr" at_fn_check_prepare_trace "calc.at:914" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:914" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_484 #AT_START_485 at_fn_group_banner 485 'calc.at:916' \ "Calculator D parse.error=verbose %debug %verbose " "" 19 at_xfail=no ( $as_echo "485. $at_setup_line: testing $at_desc ..." $at_traceon cat >calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "D" %define parse.error verbose %debug %verbose %code imports { alias semantic_value = int; } /* Exercise %union. */ %union { semantic_value ival; }; %printer { fprintf (yyo, "%d", $$); } ; /* Bison Declarations */ %token CALC_EOF 0 "end of input" %token NUM "number" %type exp %nonassoc '=' /* comparison */ %left '-' '+' %left '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line { } ; line: '\n' | exp '\n' { } ; exp: NUM | exp '=' exp { if ($1 != $3) stderr.writefln ("calc: error: %d != %d", $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; } | '!' { $$ = 0; return YYERROR; } | '-' error { $$ = 0; return YYERROR; } ; %% int power (int base, int exponent) { int res = 1; assert (0 <= exponent); for (/* Niente */; exponent; --exponent) res *= base; return res; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } import std.range.primitives; import std.stdio; auto calcLexer(R)(R range) if (isInputRange!R && is (ElementType!R : dchar)) { return new CalcLexer!R(range); } auto calcLexer (File f) { import std.algorithm : map, joiner; import std.utf : byDchar; return f.byChunk(1024) // avoid making a syscall roundtrip per char .map!(chunk => cast(char[]) chunk) // because byChunk returns ubyte[] .joiner // combine chunks into a single virtual range of char .calcLexer; // forward to other overload } class CalcLexer(R) : Lexer if (isInputRange!R && is (ElementType!R : dchar)) { R input; this(R r) { input = r; } /* An error reporting function. */ public void yyerror (string m) { stderr.writeln (m); } YYSemanticType semanticVal_; public final @property YYSemanticType semanticVal() { return semanticVal_; } int parseInt () { auto res = 0; import std.uni : isNumber; while (input.front.isNumber) { res = res * 10 + (input.front - '0'); input.popFront; } return res; } int yylex () { import std.uni : isWhite, isNumber; // Skip initial spaces while (!input.empty && input.front != '\n' && isWhite (input.front)) { input.popFront; } // Handle EOF. if (input.empty) return YYTokenType.EOF; // Numbers. if (input.front.isNumber) { semanticVal_.ival = parseInt; return YYTokenType.NUM; } // Individual characters auto c = input.front; input.popFront; return c; } } int main (string[] args) { semantic_value result = 0; int count = 0; File input = args.length == 2 ? File (args[1], "r") : stdin; auto l = calcLexer (input); auto p = new YYParser (l); 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/calc.at:916: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_notrace 'an embedded newline' "calc.at:916" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y" "calc.at:916" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.d calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/calc.at:916: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:916" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/calc.at:916: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:916" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $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:916: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d calc.y" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o calc.d 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:916" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "calc.at:916" >"$at_check_line_file" (! $BISON_DC_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/calc.at:916" { set +x $as_echo "$at_srcdir/calc.at:916: \$DC \$DCFLAGS -ofcalc calc.d" at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofcalc calc.d" "calc.at:916" ( $at_check_trace; $DC $DCFLAGS -ofcalc calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/calc.at:916: \"\$PERL\" -ne ' chomp; print \"\$ARGV:\$.: {\$_}\\n\" if (# No starting/ending empty lines. (eof || \$. == 1) && /^\\s*\$/ # No trailing space. || /\\s\$/ # No tabs. || /\\t/ )' calc.d " at_fn_check_prepare_notrace 'an embedded newline' "calc.at:916" ( $at_check_trace; "$PERL" -ne ' chomp; print "$ARGV:$.: {$_}\n" if (# No starting/ending empty lines. (eof || $. == 1) && /^\s*$/ # No trailing space. || /\s$/ # No tabs. || /\t/ )' calc.d ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } fi # Test the precedences. 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:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $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:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/calc.at:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $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:916: \$PREPARSER ./calc /dev/null" at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:916" ( $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:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $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:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $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:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (1 2) = 1 _ATEOF { set +x $as_echo "$at_srcdir/calc.at:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $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 successful. cat >input <<'_ATEOF' (* *) + (*) + (*) _ATEOF { set +x $as_echo "$at_srcdir/calc.at:916: \$PREPARSER ./calc input" at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:916" ( $at_check_trace; $PREPARSER ./calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/calc.at:916: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } # Normalize the observed and expected error messages, depending upon the # options. # 1. Remove the traces from observed. sed '/^Starting/d /^Entering/d /^Stack/d /^Reading/d /^Reducing/d /^Return/d /^Shifting/d /^state/d /^Cleanup:/d /^Error:/d /^Next/d /^Now/d /^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:916: cat stderr" at_fn_check_prepare_trace "calc.at:916" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/calc.at:916" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_485 #AT_START_486 at_fn_group_banner 486 'torture.at:132' \ "Big triangle" " " 20 at_xfail=no ( $as_echo "486. $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 < } %define parse.error verbose %debug %{ #include #include #include #define MAX $max static int yylex (void); #include 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 < MAX) return 0; else if (inner > outer) { inner = 1; ++outer; return END; } return inner++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } EOF _ATEOF { set +x $as_echo "$at_srcdir/torture.at:138: \"\$PERL\" -w ./gengram.pl 200 || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -w ./gengram.pl 200 || exit 77" "torture.at:138" ( $at_check_trace; "$PERL" -w ./gengram.pl 200 || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:138" $at_failed && at_fn_log_failure $at_traceon; } mv stdout input.y { set +x $as_echo "$at_srcdir/torture.at:139: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y" at_fn_check_prepare_trace "torture.at:139" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:139" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:140" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:140" { set +x $as_echo "$at_srcdir/torture.at:140: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:140" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:140" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:141: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:141" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:141" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:141: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:141" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:141" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_486 #AT_START_487 at_fn_group_banner 487 'torture.at:216' \ "Big horizontal" " " 20 at_xfail=no ( $as_echo "487. $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 < } %define parse.error verbose %debug %{ #include #include #define MAX $max static int yylex (void); #include static void yyerror (const char *msg); %} %token EOF for my $size (1 .. $max) { print " 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 counter = 1; if (counter <= MAX) return counter++; assert (counter++ == MAX + 1); return 0; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } EOF _ATEOF { set +x $as_echo "$at_srcdir/torture.at:230: \"\$PERL\" -w ./gengram.pl 1000 || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -w ./gengram.pl 1000 || exit 77" "torture.at:230" ( $at_check_trace; "$PERL" -w ./gengram.pl 1000 || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; tee stdout <"$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:230" $at_failed && at_fn_log_failure $at_traceon; } mv stdout input.y # GNU m4 requires about 70 MiB for this test on a 32-bit host. # Ask for 200 MiB, which should be plenty even on a 64-bit host. data_limit=`(ulimit -S -d) 2>/dev/null` case $data_limit in [0-9]*) if test "$data_limit" -lt 204000; then { set +x $as_echo "$at_srcdir/torture.at:234: ulimit -S -d 204000 || exit 77" at_fn_check_prepare_trace "torture.at:234" ( $at_check_trace; ulimit -S -d 204000 || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:234" $at_failed && at_fn_log_failure $at_traceon; } ulimit -S -d 204000 fi esac { set +x $as_echo "$at_srcdir/torture.at:236: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "torture.at:236" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:236" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:237" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:237" { set +x $as_echo "$at_srcdir/torture.at:237: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "torture.at:237" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:237" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:238: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:238" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:238" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:238: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:238" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:238" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_487 #AT_START_488 at_fn_group_banner 488 'torture.at:270' \ "State number type: 128 states" " " 20 at_xfail=no ( $as_echo "488. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/torture.at:270: ruby \$abs_top_srcdir/tests/linear 128 >input.y || exit 77" at_fn_check_prepare_dynamic "ruby $abs_top_srcdir/tests/linear 128 >input.y || exit 77" "torture.at:270" ( $at_check_trace; ruby $abs_top_srcdir/tests/linear 128 >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/torture.at:270" $at_failed && at_fn_log_failure $at_traceon; } # Old versions of GCC reject large values given to #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:270: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-line -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:270" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:270" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:270: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" "torture.at:270" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:270" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:270: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:270" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:270" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:270: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:270" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:270" $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:270: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -o input.c input.y" at_fn_check_prepare_trace "torture.at:270" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -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:270" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:270" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:270" { set +x $as_echo "$at_srcdir/torture.at:270: \$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:270" ( $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:270" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:270: sed -ne 's/#define YYNSTATES *\\([0-9]*\\)/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:270" ( $at_check_trace; sed -ne 's/#define YYNSTATES *\([0-9]*\)/\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 >>"$at_stdout"; $as_echo "128 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:270" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:270: sed -ne 's/typedef \\(.*\\) yy_state_t;/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:270" ( $at_check_trace; sed -ne 's/typedef \(.*\) yy_state_t;/\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 >>"$at_stdout"; $as_echo "yytype_int8 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:270" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:270: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:270" ( $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:270" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:270: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:270" ( $at_check_trace; 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:270" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_488 #AT_START_489 at_fn_group_banner 489 'torture.at:271' \ "State number type: 129 states" " " 20 at_xfail=no ( $as_echo "489. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/torture.at:271: ruby \$abs_top_srcdir/tests/linear 129 >input.y || exit 77" at_fn_check_prepare_dynamic "ruby $abs_top_srcdir/tests/linear 129 >input.y || exit 77" "torture.at:271" ( $at_check_trace; ruby $abs_top_srcdir/tests/linear 129 >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/torture.at:271" $at_failed && at_fn_log_failure $at_traceon; } # Old versions of GCC reject large values given to #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:271: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-line -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:271" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:271" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:271: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" "torture.at:271" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:271" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:271: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:271" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:271" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:271: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:271" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:271" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:271: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -o input.c input.y" at_fn_check_prepare_trace "torture.at:271" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -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:271" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:271" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:271" { set +x $as_echo "$at_srcdir/torture.at:271: \$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:271" ( $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:271" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:271: sed -ne 's/#define YYNSTATES *\\([0-9]*\\)/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:271" ( $at_check_trace; sed -ne 's/#define YYNSTATES *\([0-9]*\)/\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 >>"$at_stdout"; $as_echo "129 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:271" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:271: sed -ne 's/typedef \\(.*\\) yy_state_t;/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:271" ( $at_check_trace; sed -ne 's/typedef \(.*\) yy_state_t;/\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 >>"$at_stdout"; $as_echo "yytype_uint8 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:271" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:271: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:271" ( $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:271" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:271: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:271" ( $at_check_trace; 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:271" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_489 #AT_START_490 at_fn_group_banner 490 'torture.at:272' \ "State number type: 256 states" " " 20 at_xfail=no ( $as_echo "490. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/torture.at:272: ruby \$abs_top_srcdir/tests/linear 256 >input.y || exit 77" at_fn_check_prepare_dynamic "ruby $abs_top_srcdir/tests/linear 256 >input.y || exit 77" "torture.at:272" ( $at_check_trace; ruby $abs_top_srcdir/tests/linear 256 >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/torture.at:272" $at_failed && at_fn_log_failure $at_traceon; } # Old versions of GCC reject large values given to #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:272: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-line -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:272" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:272" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:272: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" "torture.at:272" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:272" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:272: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:272" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:272" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:272: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:272" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:272" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:272: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -o input.c input.y" at_fn_check_prepare_trace "torture.at:272" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -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:272" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:272" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:272" { set +x $as_echo "$at_srcdir/torture.at:272: \$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:272" ( $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:272" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:272: sed -ne 's/#define YYNSTATES *\\([0-9]*\\)/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:272" ( $at_check_trace; sed -ne 's/#define YYNSTATES *\([0-9]*\)/\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 >>"$at_stdout"; $as_echo "256 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:272" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:272: sed -ne 's/typedef \\(.*\\) yy_state_t;/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:272" ( $at_check_trace; sed -ne 's/typedef \(.*\) yy_state_t;/\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 >>"$at_stdout"; $as_echo "yytype_uint8 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:272" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:272: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:272" ( $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:272" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:272: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:272" ( $at_check_trace; 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:272" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_490 #AT_START_491 at_fn_group_banner 491 'torture.at:273' \ "State number type: 257 states" " " 20 at_xfail=no ( $as_echo "491. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/torture.at:273: ruby \$abs_top_srcdir/tests/linear 257 >input.y || exit 77" at_fn_check_prepare_dynamic "ruby $abs_top_srcdir/tests/linear 257 >input.y || exit 77" "torture.at:273" ( $at_check_trace; ruby $abs_top_srcdir/tests/linear 257 >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/torture.at:273" $at_failed && at_fn_log_failure $at_traceon; } # Old versions of GCC reject large values given to #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:273: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-line -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:273" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:273" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:273: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" "torture.at:273" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:273" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:273: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:273" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:273" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:273: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:273" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:273" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:273: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -o input.c input.y" at_fn_check_prepare_trace "torture.at:273" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -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:273" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:273" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:273" { set +x $as_echo "$at_srcdir/torture.at:273: \$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:273" ( $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:273" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:273: sed -ne 's/#define YYNSTATES *\\([0-9]*\\)/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:273" ( $at_check_trace; sed -ne 's/#define YYNSTATES *\([0-9]*\)/\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 >>"$at_stdout"; $as_echo "257 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:273" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:273: sed -ne 's/typedef \\(.*\\) yy_state_t;/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:273" ( $at_check_trace; sed -ne 's/typedef \(.*\) yy_state_t;/\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 >>"$at_stdout"; $as_echo "yytype_int16 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:273" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:273: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:273" ( $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:273" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:273: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:273" ( $at_check_trace; 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:273" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_491 #AT_START_492 at_fn_group_banner 492 'torture.at:274' \ "State number type: 32768 states" " " 20 at_xfail=no ( $as_echo "492. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/torture.at:274: ruby \$abs_top_srcdir/tests/linear 32768 >input.y || exit 77" at_fn_check_prepare_dynamic "ruby $abs_top_srcdir/tests/linear 32768 >input.y || exit 77" "torture.at:274" ( $at_check_trace; ruby $abs_top_srcdir/tests/linear 32768 >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/torture.at:274" $at_failed && at_fn_log_failure $at_traceon; } # Old versions of GCC reject large values given to #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:274: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-line -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:274" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:274: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" "torture.at:274" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:274" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:274: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:274" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:274" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:274: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:274" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:274" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:274: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -o input.c input.y" at_fn_check_prepare_trace "torture.at:274" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -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:274" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:274" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:274" { set +x $as_echo "$at_srcdir/torture.at:274: \$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:274" ( $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:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:274: sed -ne 's/#define YYNSTATES *\\([0-9]*\\)/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:274" ( $at_check_trace; sed -ne 's/#define YYNSTATES *\([0-9]*\)/\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 >>"$at_stdout"; $as_echo "32768 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:274: sed -ne 's/typedef \\(.*\\) yy_state_t;/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:274" ( $at_check_trace; sed -ne 's/typedef \(.*\) yy_state_t;/\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 >>"$at_stdout"; $as_echo "yytype_int16 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:274: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:274" ( $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:274" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:274: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.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/torture.at:274" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_492 #AT_START_493 at_fn_group_banner 493 'torture.at:275' \ "State number type: 65536 states" " " 20 at_xfail=no ( $as_echo "493. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/torture.at:275: ruby \$abs_top_srcdir/tests/linear 65536 >input.y || exit 77" at_fn_check_prepare_dynamic "ruby $abs_top_srcdir/tests/linear 65536 >input.y || exit 77" "torture.at:275" ( $at_check_trace; ruby $abs_top_srcdir/tests/linear 65536 >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/torture.at:275" $at_failed && at_fn_log_failure $at_traceon; } # Old versions of GCC reject large values given to #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:275: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-line -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:275" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:275" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:275: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" "torture.at:275" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:275" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:275: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:275" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:275" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:275: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:275" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:275" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:275: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -o input.c input.y" at_fn_check_prepare_trace "torture.at:275" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -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:275" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:275" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:275" { set +x $as_echo "$at_srcdir/torture.at:275: \$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:275" ( $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:275" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:275: sed -ne 's/#define YYNSTATES *\\([0-9]*\\)/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:275" ( $at_check_trace; sed -ne 's/#define YYNSTATES *\([0-9]*\)/\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 >>"$at_stdout"; $as_echo "65536 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:275" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:275: sed -ne 's/typedef \\(.*\\) yy_state_t;/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:275" ( $at_check_trace; sed -ne 's/typedef \(.*\) yy_state_t;/\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 >>"$at_stdout"; $as_echo "yytype_uint16 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:275" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:275: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:275" ( $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:275" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:275: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:275" ( $at_check_trace; 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:275" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_493 #AT_START_494 at_fn_group_banner 494 'torture.at:276' \ "State number type: 65537 states" " " 20 at_xfail=no ( $as_echo "494. $at_setup_line: testing $at_desc ..." $at_traceon { set +x $as_echo "$at_srcdir/torture.at:276: ruby \$abs_top_srcdir/tests/linear 65537 >input.y || exit 77" at_fn_check_prepare_dynamic "ruby $abs_top_srcdir/tests/linear 65537 >input.y || exit 77" "torture.at:276" ( $at_check_trace; ruby $abs_top_srcdir/tests/linear 65537 >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/torture.at:276" $at_failed && at_fn_log_failure $at_traceon; } # Old versions of GCC reject large values given to #line. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:276: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --no-line -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:276" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:276" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:276: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y" "torture.at:276" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-line -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:276" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:276: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:276" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:276" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:276: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:276" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:276" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:276: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -o input.c input.y" at_fn_check_prepare_trace "torture.at:276" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --no-line -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:276" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:276" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:276" { set +x $as_echo "$at_srcdir/torture.at:276: \$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:276" ( $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:276" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:276: sed -ne 's/#define YYNSTATES *\\([0-9]*\\)/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:276" ( $at_check_trace; sed -ne 's/#define YYNSTATES *\([0-9]*\)/\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 >>"$at_stdout"; $as_echo "65537 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:276" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:276: sed -ne 's/typedef \\(.*\\) yy_state_t;/\\1/p' input.c" at_fn_check_prepare_trace "torture.at:276" ( $at_check_trace; sed -ne 's/typedef \(.*\) yy_state_t;/\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 >>"$at_stdout"; $as_echo "int " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:276" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:276: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:276" ( $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:276" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:276: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:276" ( $at_check_trace; 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:276" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_494 #AT_START_495 at_fn_group_banner 495 'torture.at:385' \ "Many lookahead tokens" " " 20 at_xfail=no ( $as_echo "495. $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 < # include # include # include # define MAX $max static int yylex (void); #include 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 < MAX) { assert (counter++ == MAX + 1); return 0; } if (return_token) { return_token = 0; return token; } return_token = 1; return counter++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } EOF _ATEOF { set +x $as_echo "$at_srcdir/torture.at:387: \"\$PERL\" -w ./gengram.pl 1000 || exit 77" at_fn_check_prepare_dynamic "\"$PERL\" -w ./gengram.pl 1000 || exit 77" "torture.at:387" ( $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:387" $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:391: ulimit -S -d 204000 || exit 77" at_fn_check_prepare_trace "torture.at:391" ( $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:391" $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:393: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:393" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:393" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:393: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "torture.at:393" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:393" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:393: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:393" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:393" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:393: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:393" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:393" $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:393: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y" at_fn_check_prepare_trace "torture.at:393" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:393" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:394" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:394" { set +x $as_echo "$at_srcdir/torture.at:394: \$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:394" ( $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:394" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:395: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "torture.at:395" ( $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:395" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:395" ( $at_check_trace; 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:395" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_495 #AT_START_496 at_fn_group_banner 496 'torture.at:487' \ "Exploding the Stack Size with Alloca" " " 20 at_xfail=no ( $as_echo "496. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #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); #include static void yyerror (const char *msg); %} %define parse.error verbose %debug %token WAIT_FOR_EOF %% exp: WAIT_FOR_EOF exp | ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include 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) { long res; char *endp; assert (argc == 2); (void) argc; res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); assert (res <= INT_MAX); assert (errno != ERANGE); return YY_CAST (int, 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:496: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:496" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:496" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:496: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:496" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:496" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:496: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:496" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:496" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:496: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:496" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:496" $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:496: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "torture.at:496" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:496" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:496" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:496" { set +x $as_echo "$at_srcdir/torture.at:496: \$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:496" ( $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:496" $at_failed && at_fn_log_failure $at_traceon; } # Below the limit of 200. { set +x $as_echo "$at_srcdir/torture.at:500: 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:500" ( $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:500" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:500: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:500" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:500" $at_failed && at_fn_log_failure $at_traceon; } # Two enlargements: 2 * 2 * 200. { set +x $as_echo "$at_srcdir/torture.at:503: 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:503" ( $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:503" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:503: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:503" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:503" $at_failed && at_fn_log_failure $at_traceon; } # 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:507: 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:507" ( $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:507" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:507: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:507" ( $at_check_trace; sed >&2 -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:507" $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #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); #include static void yyerror (const char *msg); %} %define api.push-pull both %define parse.error verbose %debug %token WAIT_FOR_EOF %% exp: WAIT_FOR_EOF exp | ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include 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) { long res; char *endp; assert (argc == 2); (void) argc; res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); assert (res <= INT_MAX); assert (errno != ERANGE); return YY_CAST (int, 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:514: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:514" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:514: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:514" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:514: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:514" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:514" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:514: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:514" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:514" $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:514: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "torture.at:514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:514" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:514" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:514" { set +x $as_echo "$at_srcdir/torture.at:514: \$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:514" ( $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:514" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:516: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 20" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 20" "torture.at:516" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 20 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:516: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:516" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:516" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:518: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 900" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 900" "torture.at:518" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 900 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:518" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:518: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:518" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:518" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:520: VALGRIND_OPTS=\"\$VALGRIND_OPTS --log-fd=1\" \$PREPARSER ./input 10000" at_fn_check_prepare_dynamic "VALGRIND_OPTS=\"$VALGRIND_OPTS --log-fd=1\" $PREPARSER ./input 10000" "torture.at:520" ( $at_check_trace; VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1" $PREPARSER ./input 10000 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/torture.at:520" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:520: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:520" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:520" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_496 #AT_START_497 at_fn_group_banner 497 'torture.at:533' \ "Exploding the Stack Size with Malloc" " " 20 at_xfail=no ( $as_echo "497. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include #include #define YYSTACK_USE_ALLOCA 0 static int yylex (void); #include static void yyerror (const char *msg); %} %define parse.error verbose %debug %token WAIT_FOR_EOF %% exp: WAIT_FOR_EOF exp | ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include 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) { long res; char *endp; assert (argc == 2); (void) argc; res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); assert (res <= INT_MAX); assert (errno != ERANGE); return YY_CAST (int, 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:537: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:537" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:537" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:537: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:537" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:537" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:537: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:537" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:537" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:537: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:537" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:537" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/torture.at:537: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "torture.at:537" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:537" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:537" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:537" { set +x $as_echo "$at_srcdir/torture.at:537: \$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:537" ( $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:537" $at_failed && at_fn_log_failure $at_traceon; } # Below the limit of 200. { set +x $as_echo "$at_srcdir/torture.at:541: 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:541" ( $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:541" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:541: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:541" ( $at_check_trace; sed >&2 -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:541" $at_failed && at_fn_log_failure $at_traceon; } # Two enlargements: 2 * 2 * 200. { set +x $as_echo "$at_srcdir/torture.at:544: 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:544" ( $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:544" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:544: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:544" ( $at_check_trace; sed >&2 -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:544" $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:548: 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:548" ( $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:548" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:548: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:548" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:548" $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include #include #define YYSTACK_USE_ALLOCA 0 static int yylex (void); #include static void yyerror (const char *msg); %} %define api.push-pull both %define parse.error verbose %debug %token WAIT_FOR_EOF %% exp: WAIT_FOR_EOF exp | ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include 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) { long res; char *endp; assert (argc == 2); (void) argc; res = strtol (argv[1], &endp, 10); assert (argv[1] != endp); assert (0 <= res); assert (res <= INT_MAX); assert (errno != ERANGE); return YY_CAST (int, 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:552: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "torture.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:552: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "torture.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/torture.at:552" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/torture.at:552: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:552" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:552" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/torture.at:552: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:552" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:552" $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:552: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "torture.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/torture.at:552" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "torture.at:552" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/torture.at:552" { set +x $as_echo "$at_srcdir/torture.at:552: \$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:552" ( $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:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:554: 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:554" ( $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:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:554: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:554" ( $at_check_trace; sed >&2 -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:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:556: 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:556" ( $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:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:556: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:556" ( $at_check_trace; sed >&2 -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:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:558: 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:558" ( $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:558" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/torture.at:558: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "torture.at:558" ( $at_check_trace; sed >&2 -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:558" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_497 #AT_START_498 at_fn_group_banner 498 'existing.at:801' \ "GNU AWK 3.1.0 Grammar: LALR(1)" " " 21 at_xfail=no ( $as_echo "498. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type lalr %define parse.error verbose %token FUNC_CALL NAME REGEXP %token ERROR %token YNUMBER YSTRING %token RELOP APPEND_OP %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION %token LEX_GETLINE LEX_NEXTFILE %token LEX_IN %token LEX_AND LEX_OR INCREMENT DECREMENT %token LEX_BUILTIN LEX_LENGTH /* Lowest to highest */ %right ASSIGNOP %right '?' ':' %left LEX_OR %left LEX_AND %left LEX_GETLINE %nonassoc LEX_IN %left FUNC_CALL LEX_BUILTIN LEX_LENGTH %nonassoc ',' %nonassoc MATCHOP %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO %left CONCAT_OP %left YSTRING YNUMBER %left '+' '-' %left '*' '/' '%' %right '!' UNARY %right '^' %left INCREMENT DECREMENT %left '$' %left '(' ')' %% start : opt_nls program opt_nls ; program : rule | program rule | error | program error | /* empty */ ; rule : LEX_BEGIN {} action | LEX_END {} action | LEX_BEGIN statement_term | LEX_END statement_term | pattern action | action | pattern statement_term | function_prologue function_body ; func_name : NAME | FUNC_CALL | lex_builtin ; lex_builtin : LEX_BUILTIN | LEX_LENGTH ; function_prologue : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls ; function_body : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; pattern : exp | exp ',' exp ; regexp /* * In this rule, want_regexp tells yylex that the next thing * is a regexp so it should read up to the closing slash. */ : '/' {} REGEXP '/' ; action : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; statements : statement | statements statement | error | statements error ; statement_term : nls | semi opt_nls ; statement : semi opt_nls | l_brace r_brace | l_brace statements r_brace | if_statement | LEX_WHILE '(' exp r_paren opt_nls statement | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement | LEX_BREAK statement_term | LEX_CONTINUE statement_term | print '(' expression_list r_paren output_redir statement_term | print opt_rexpression_list output_redir statement_term | LEX_NEXT statement_term | LEX_NEXTFILE statement_term | LEX_EXIT opt_exp statement_term | LEX_RETURN {} opt_exp statement_term | LEX_DELETE NAME '[' expression_list ']' statement_term | LEX_DELETE NAME statement_term | exp statement_term ; print : LEX_PRINT | LEX_PRINTF ; if_statement : LEX_IF '(' exp r_paren opt_nls statement | LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE opt_nls statement ; nls : NEWLINE | nls NEWLINE ; opt_nls : /* empty */ | nls ; input_redir : /* empty */ | '<' simp_exp ; output_redir : /* empty */ | '>' exp | APPEND_OP exp | '|' exp | TWOWAYIO exp ; opt_param_list : /* empty */ | param_list ; param_list : NAME | param_list comma NAME | error | param_list error | param_list comma error ; /* optional expression, as in for loop */ opt_exp : /* empty */ | exp ; opt_rexpression_list : /* empty */ | rexpression_list ; rexpression_list : rexp | rexpression_list comma rexp | error | rexpression_list error | rexpression_list error rexp | rexpression_list comma error ; opt_expression_list : /* empty */ | expression_list ; expression_list : exp | expression_list comma exp | error | expression_list error | expression_list error exp | expression_list comma error ; /* Expressions, not including the comma operator. */ exp : variable ASSIGNOP {} exp | '(' expression_list r_paren LEX_IN NAME | exp '|' LEX_GETLINE opt_variable | exp TWOWAYIO LEX_GETLINE opt_variable | LEX_GETLINE opt_variable input_redir | exp LEX_AND exp | exp LEX_OR exp | exp MATCHOP exp | regexp | '!' regexp %prec UNARY | exp LEX_IN NAME | exp RELOP exp | exp '<' exp | exp '>' exp | exp '?' exp ':' exp | simp_exp | exp simp_exp %prec CONCAT_OP ; rexp : variable ASSIGNOP {} rexp | rexp LEX_AND rexp | rexp LEX_OR rexp | LEX_GETLINE opt_variable input_redir | regexp | '!' regexp %prec UNARY | rexp MATCHOP rexp | rexp LEX_IN NAME | rexp RELOP rexp | rexp '?' rexp ':' rexp | simp_exp | rexp simp_exp %prec CONCAT_OP ; simp_exp : non_post_simp_exp /* Binary operators in order of decreasing precedence. */ | simp_exp '^' simp_exp | simp_exp '*' simp_exp | simp_exp '/' simp_exp | simp_exp '%' simp_exp | simp_exp '+' simp_exp | simp_exp '-' simp_exp | variable INCREMENT | variable DECREMENT ; non_post_simp_exp : '!' simp_exp %prec UNARY | '(' exp r_paren | LEX_BUILTIN '(' opt_expression_list r_paren | LEX_LENGTH '(' opt_expression_list r_paren | LEX_LENGTH | FUNC_CALL '(' opt_expression_list r_paren | variable | INCREMENT variable | DECREMENT variable | YNUMBER | YSTRING | '-' simp_exp %prec UNARY | '+' simp_exp %prec UNARY ; opt_variable : /* empty */ | variable ; variable : NAME | NAME '[' expression_list ']' | '$' non_post_simp_exp ; l_brace : '{' opt_nls ; r_brace : '}' opt_nls ; r_paren : ')' ; opt_semi : /* empty */ | semi ; semi : ';' ; comma : ',' opt_nls ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule] input.y:170.10: warning: empty rule without %empty [-Wempty-rule] input.y:175.10: warning: empty rule without %empty [-Wempty-rule] input.y:180.10: warning: empty rule without %empty [-Wempty-rule] input.y:188.10: warning: empty rule without %empty [-Wempty-rule] input.y:202.10: warning: empty rule without %empty [-Wempty-rule] input.y:207.10: warning: empty rule without %empty [-Wempty-rule] input.y:221.10: warning: empty rule without %empty [-Wempty-rule] input.y:300.10: warning: empty rule without %empty [-Wempty-rule] input.y:323.10: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr] input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:801" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:66.10: warning: empty rule without %empty [-Wempty-rule] input.y:170.10: warning: empty rule without %empty [-Wempty-rule] input.y:175.10: warning: empty rule without %empty [-Wempty-rule] input.y:180.10: warning: empty rule without %empty [-Wempty-rule] input.y:188.10: warning: empty rule without %empty [-Wempty-rule] input.y:202.10: warning: empty rule without %empty [-Wempty-rule] input.y:207.10: warning: empty rule without %empty [-Wempty-rule] input.y:221.10: warning: empty rule without %empty [-Wempty-rule] input.y:300.10: warning: empty rule without %empty [-Wempty-rule] input.y:323.10: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr] input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:801: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:801" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:801: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: 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:801" ( $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:801" $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:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:801" ( $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:801" $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. $as_echo "existing.at:801" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:801" { set +x $as_echo "$at_srcdir/existing.at:801: \$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:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:801" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:801" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_498 #AT_START_499 at_fn_group_banner 499 'existing.at:801' \ "GNU AWK 3.1.0 Grammar: IELR(1)" " " 21 at_xfail=no ( $as_echo "499. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type ielr %define parse.error verbose %token FUNC_CALL NAME REGEXP %token ERROR %token YNUMBER YSTRING %token RELOP APPEND_OP %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION %token LEX_GETLINE LEX_NEXTFILE %token LEX_IN %token LEX_AND LEX_OR INCREMENT DECREMENT %token LEX_BUILTIN LEX_LENGTH /* Lowest to highest */ %right ASSIGNOP %right '?' ':' %left LEX_OR %left LEX_AND %left LEX_GETLINE %nonassoc LEX_IN %left FUNC_CALL LEX_BUILTIN LEX_LENGTH %nonassoc ',' %nonassoc MATCHOP %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO %left CONCAT_OP %left YSTRING YNUMBER %left '+' '-' %left '*' '/' '%' %right '!' UNARY %right '^' %left INCREMENT DECREMENT %left '$' %left '(' ')' %% start : opt_nls program opt_nls ; program : rule | program rule | error | program error | /* empty */ ; rule : LEX_BEGIN {} action | LEX_END {} action | LEX_BEGIN statement_term | LEX_END statement_term | pattern action | action | pattern statement_term | function_prologue function_body ; func_name : NAME | FUNC_CALL | lex_builtin ; lex_builtin : LEX_BUILTIN | LEX_LENGTH ; function_prologue : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls ; function_body : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; pattern : exp | exp ',' exp ; regexp /* * In this rule, want_regexp tells yylex that the next thing * is a regexp so it should read up to the closing slash. */ : '/' {} REGEXP '/' ; action : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; statements : statement | statements statement | error | statements error ; statement_term : nls | semi opt_nls ; statement : semi opt_nls | l_brace r_brace | l_brace statements r_brace | if_statement | LEX_WHILE '(' exp r_paren opt_nls statement | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement | LEX_BREAK statement_term | LEX_CONTINUE statement_term | print '(' expression_list r_paren output_redir statement_term | print opt_rexpression_list output_redir statement_term | LEX_NEXT statement_term | LEX_NEXTFILE statement_term | LEX_EXIT opt_exp statement_term | LEX_RETURN {} opt_exp statement_term | LEX_DELETE NAME '[' expression_list ']' statement_term | LEX_DELETE NAME statement_term | exp statement_term ; print : LEX_PRINT | LEX_PRINTF ; if_statement : LEX_IF '(' exp r_paren opt_nls statement | LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE opt_nls statement ; nls : NEWLINE | nls NEWLINE ; opt_nls : /* empty */ | nls ; input_redir : /* empty */ | '<' simp_exp ; output_redir : /* empty */ | '>' exp | APPEND_OP exp | '|' exp | TWOWAYIO exp ; opt_param_list : /* empty */ | param_list ; param_list : NAME | param_list comma NAME | error | param_list error | param_list comma error ; /* optional expression, as in for loop */ opt_exp : /* empty */ | exp ; opt_rexpression_list : /* empty */ | rexpression_list ; rexpression_list : rexp | rexpression_list comma rexp | error | rexpression_list error | rexpression_list error rexp | rexpression_list comma error ; opt_expression_list : /* empty */ | expression_list ; expression_list : exp | expression_list comma exp | error | expression_list error | expression_list error exp | expression_list comma error ; /* Expressions, not including the comma operator. */ exp : variable ASSIGNOP {} exp | '(' expression_list r_paren LEX_IN NAME | exp '|' LEX_GETLINE opt_variable | exp TWOWAYIO LEX_GETLINE opt_variable | LEX_GETLINE opt_variable input_redir | exp LEX_AND exp | exp LEX_OR exp | exp MATCHOP exp | regexp | '!' regexp %prec UNARY | exp LEX_IN NAME | exp RELOP exp | exp '<' exp | exp '>' exp | exp '?' exp ':' exp | simp_exp | exp simp_exp %prec CONCAT_OP ; rexp : variable ASSIGNOP {} rexp | rexp LEX_AND rexp | rexp LEX_OR rexp | LEX_GETLINE opt_variable input_redir | regexp | '!' regexp %prec UNARY | rexp MATCHOP rexp | rexp LEX_IN NAME | rexp RELOP rexp | rexp '?' rexp ':' rexp | simp_exp | rexp simp_exp %prec CONCAT_OP ; simp_exp : non_post_simp_exp /* Binary operators in order of decreasing precedence. */ | simp_exp '^' simp_exp | simp_exp '*' simp_exp | simp_exp '/' simp_exp | simp_exp '%' simp_exp | simp_exp '+' simp_exp | simp_exp '-' simp_exp | variable INCREMENT | variable DECREMENT ; non_post_simp_exp : '!' simp_exp %prec UNARY | '(' exp r_paren | LEX_BUILTIN '(' opt_expression_list r_paren | LEX_LENGTH '(' opt_expression_list r_paren | LEX_LENGTH | FUNC_CALL '(' opt_expression_list r_paren | variable | INCREMENT variable | DECREMENT variable | YNUMBER | YSTRING | '-' simp_exp %prec UNARY | '+' simp_exp %prec UNARY ; opt_variable : /* empty */ | variable ; variable : NAME | NAME '[' expression_list ']' | '$' non_post_simp_exp ; l_brace : '{' opt_nls ; r_brace : '}' opt_nls ; r_paren : ')' ; opt_semi : /* empty */ | semi ; semi : ';' ; comma : ',' opt_nls ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule] input.y:170.10: warning: empty rule without %empty [-Wempty-rule] input.y:175.10: warning: empty rule without %empty [-Wempty-rule] input.y:180.10: warning: empty rule without %empty [-Wempty-rule] input.y:188.10: warning: empty rule without %empty [-Wempty-rule] input.y:202.10: warning: empty rule without %empty [-Wempty-rule] input.y:207.10: warning: empty rule without %empty [-Wempty-rule] input.y:221.10: warning: empty rule without %empty [-Wempty-rule] input.y:300.10: warning: empty rule without %empty [-Wempty-rule] input.y:323.10: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr] input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:801" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:66.10: warning: empty rule without %empty [-Wempty-rule] input.y:170.10: warning: empty rule without %empty [-Wempty-rule] input.y:175.10: warning: empty rule without %empty [-Wempty-rule] input.y:180.10: warning: empty rule without %empty [-Wempty-rule] input.y:188.10: warning: empty rule without %empty [-Wempty-rule] input.y:202.10: warning: empty rule without %empty [-Wempty-rule] input.y:207.10: warning: empty rule without %empty [-Wempty-rule] input.y:221.10: warning: empty rule without %empty [-Wempty-rule] input.y:300.10: warning: empty rule without %empty [-Wempty-rule] input.y:323.10: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr] input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:801: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:801" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:801: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: 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:801" ( $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:801" $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:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:801: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:801" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:801" ( $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 "@@ -747,7 +747,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)] @@ -5414,7 +5414,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)] @@ -5434,7 +5434,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)] @@ -6249,7 +6249,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)] @@ -11134,3 +11134,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:801" $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. $as_echo "existing.at:801" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:801" { set +x $as_echo "$at_srcdir/existing.at:801: \$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:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:801" ( $at_check_trace; 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:801" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_499 #AT_START_500 at_fn_group_banner 500 'existing.at:801' \ "GNU AWK 3.1.0 Grammar: Canonical LR(1)" " " 21 at_xfail=no ( $as_echo "500. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type canonical-lr %define parse.error verbose %token FUNC_CALL NAME REGEXP %token ERROR %token YNUMBER YSTRING %token RELOP APPEND_OP %token ASSIGNOP MATCHOP NEWLINE CONCAT_OP %token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE %token LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE %token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION %token LEX_GETLINE LEX_NEXTFILE %token LEX_IN %token LEX_AND LEX_OR INCREMENT DECREMENT %token LEX_BUILTIN LEX_LENGTH /* Lowest to highest */ %right ASSIGNOP %right '?' ':' %left LEX_OR %left LEX_AND %left LEX_GETLINE %nonassoc LEX_IN %left FUNC_CALL LEX_BUILTIN LEX_LENGTH %nonassoc ',' %nonassoc MATCHOP %nonassoc RELOP '<' '>' '|' APPEND_OP TWOWAYIO %left CONCAT_OP %left YSTRING YNUMBER %left '+' '-' %left '*' '/' '%' %right '!' UNARY %right '^' %left INCREMENT DECREMENT %left '$' %left '(' ')' %% start : opt_nls program opt_nls ; program : rule | program rule | error | program error | /* empty */ ; rule : LEX_BEGIN {} action | LEX_END {} action | LEX_BEGIN statement_term | LEX_END statement_term | pattern action | action | pattern statement_term | function_prologue function_body ; func_name : NAME | FUNC_CALL | lex_builtin ; lex_builtin : LEX_BUILTIN | LEX_LENGTH ; function_prologue : LEX_FUNCTION {} func_name '(' opt_param_list r_paren opt_nls ; function_body : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; pattern : exp | exp ',' exp ; regexp /* * In this rule, want_regexp tells yylex that the next thing * is a regexp so it should read up to the closing slash. */ : '/' {} REGEXP '/' ; action : l_brace statements r_brace opt_semi opt_nls | l_brace r_brace opt_semi opt_nls ; statements : statement | statements statement | error | statements error ; statement_term : nls | semi opt_nls ; statement : semi opt_nls | l_brace r_brace | l_brace statements r_brace | if_statement | LEX_WHILE '(' exp r_paren opt_nls statement | LEX_DO opt_nls statement LEX_WHILE '(' exp r_paren opt_nls | LEX_FOR '(' NAME LEX_IN NAME r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls exp semi opt_nls opt_exp r_paren opt_nls statement | LEX_FOR '(' opt_exp semi opt_nls semi opt_nls opt_exp r_paren opt_nls statement | LEX_BREAK statement_term | LEX_CONTINUE statement_term | print '(' expression_list r_paren output_redir statement_term | print opt_rexpression_list output_redir statement_term | LEX_NEXT statement_term | LEX_NEXTFILE statement_term | LEX_EXIT opt_exp statement_term | LEX_RETURN {} opt_exp statement_term | LEX_DELETE NAME '[' expression_list ']' statement_term | LEX_DELETE NAME statement_term | exp statement_term ; print : LEX_PRINT | LEX_PRINTF ; if_statement : LEX_IF '(' exp r_paren opt_nls statement | LEX_IF '(' exp r_paren opt_nls statement LEX_ELSE opt_nls statement ; nls : NEWLINE | nls NEWLINE ; opt_nls : /* empty */ | nls ; input_redir : /* empty */ | '<' simp_exp ; output_redir : /* empty */ | '>' exp | APPEND_OP exp | '|' exp | TWOWAYIO exp ; opt_param_list : /* empty */ | param_list ; param_list : NAME | param_list comma NAME | error | param_list error | param_list comma error ; /* optional expression, as in for loop */ opt_exp : /* empty */ | exp ; opt_rexpression_list : /* empty */ | rexpression_list ; rexpression_list : rexp | rexpression_list comma rexp | error | rexpression_list error | rexpression_list error rexp | rexpression_list comma error ; opt_expression_list : /* empty */ | expression_list ; expression_list : exp | expression_list comma exp | error | expression_list error | expression_list error exp | expression_list comma error ; /* Expressions, not including the comma operator. */ exp : variable ASSIGNOP {} exp | '(' expression_list r_paren LEX_IN NAME | exp '|' LEX_GETLINE opt_variable | exp TWOWAYIO LEX_GETLINE opt_variable | LEX_GETLINE opt_variable input_redir | exp LEX_AND exp | exp LEX_OR exp | exp MATCHOP exp | regexp | '!' regexp %prec UNARY | exp LEX_IN NAME | exp RELOP exp | exp '<' exp | exp '>' exp | exp '?' exp ':' exp | simp_exp | exp simp_exp %prec CONCAT_OP ; rexp : variable ASSIGNOP {} rexp | rexp LEX_AND rexp | rexp LEX_OR rexp | LEX_GETLINE opt_variable input_redir | regexp | '!' regexp %prec UNARY | rexp MATCHOP rexp | rexp LEX_IN NAME | rexp RELOP rexp | rexp '?' rexp ':' rexp | simp_exp | rexp simp_exp %prec CONCAT_OP ; simp_exp : non_post_simp_exp /* Binary operators in order of decreasing precedence. */ | simp_exp '^' simp_exp | simp_exp '*' simp_exp | simp_exp '/' simp_exp | simp_exp '%' simp_exp | simp_exp '+' simp_exp | simp_exp '-' simp_exp | variable INCREMENT | variable DECREMENT ; non_post_simp_exp : '!' simp_exp %prec UNARY | '(' exp r_paren | LEX_BUILTIN '(' opt_expression_list r_paren | LEX_LENGTH '(' opt_expression_list r_paren | LEX_LENGTH | FUNC_CALL '(' opt_expression_list r_paren | variable | INCREMENT variable | DECREMENT variable | YNUMBER | YSTRING | '-' simp_exp %prec UNARY | '+' simp_exp %prec UNARY ; opt_variable : /* empty */ | variable ; variable : NAME | NAME '[' expression_list ']' | '$' non_post_simp_exp ; l_brace : '{' opt_nls ; r_brace : '}' opt_nls ; r_paren : ')' ; opt_semi : /* empty */ | semi ; semi : ';' ; comma : ',' opt_nls ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { LEX_GETLINE, '$', '!', YNUMBER, '*', YNUMBER, ';', 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:66.10: warning: empty rule without %empty [-Wempty-rule] input.y:170.10: warning: empty rule without %empty [-Wempty-rule] input.y:175.10: warning: empty rule without %empty [-Wempty-rule] input.y:180.10: warning: empty rule without %empty [-Wempty-rule] input.y:188.10: warning: empty rule without %empty [-Wempty-rule] input.y:202.10: warning: empty rule without %empty [-Wempty-rule] input.y:207.10: warning: empty rule without %empty [-Wempty-rule] input.y:221.10: warning: empty rule without %empty [-Wempty-rule] input.y:300.10: warning: empty rule without %empty [-Wempty-rule] input.y:323.10: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr] input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] input.y:50.1-5: warning: useless associativity for '\$', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:801" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:66.10: warning: empty rule without %empty [-Wempty-rule] input.y:170.10: warning: empty rule without %empty [-Wempty-rule] input.y:175.10: warning: empty rule without %empty [-Wempty-rule] input.y:180.10: warning: empty rule without %empty [-Wempty-rule] input.y:188.10: warning: empty rule without %empty [-Wempty-rule] input.y:202.10: warning: empty rule without %empty [-Wempty-rule] input.y:207.10: warning: empty rule without %empty [-Wempty-rule] input.y:221.10: warning: empty rule without %empty [-Wempty-rule] input.y:300.10: warning: empty rule without %empty [-Wempty-rule] input.y:323.10: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr] input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:801: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:801" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:801" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:801" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:801" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:801: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:801" ( $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:801" $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 $as_echo "existing.at:801" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:801" { set +x $as_echo "$at_srcdir/existing.at:801: \$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:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:801" ( $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:801" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:801: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:801" ( $at_check_trace; 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:801" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_500 #AT_START_501 at_fn_group_banner 501 'existing.at:1453' \ "GNU Cim Grammar: LALR(1)" " " 21 at_xfail=no ( $as_echo "501. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $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:1453: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:128.18: warning: empty rule without %empty [-Wempty-rule] input.y:137.18: warning: empty rule without %empty [-Wempty-rule] input.y:142.18: warning: empty rule without %empty [-Wempty-rule] input.y:161.18: warning: empty rule without %empty [-Wempty-rule] input.y:179.18: warning: empty rule without %empty [-Wempty-rule] input.y:205.18: warning: empty rule without %empty [-Wempty-rule] input.y:213.18: warning: empty rule without %empty [-Wempty-rule] input.y:225.18: warning: empty rule without %empty [-Wempty-rule] input.y:292.18: warning: empty rule without %empty [-Wempty-rule] input.y:294.20: warning: empty rule without %empty [-Wempty-rule] input.y:367.18: warning: empty rule without %empty [-Wempty-rule] input.y:373.18: warning: empty rule without %empty [-Wempty-rule] input.y:387.18: warning: empty rule without %empty [-Wempty-rule] input.y:401.18: warning: empty rule without %empty [-Wempty-rule] input.y:413.18: warning: empty rule without %empty [-Wempty-rule] input.y:443.18: warning: empty rule without %empty [-Wempty-rule] input.y:471.18: warning: empty rule without %empty [-Wempty-rule] input.y:474.18: warning: empty rule without %empty [-Wempty-rule] input.y:489.18: warning: empty rule without %empty [-Wempty-rule] input.y:506.18: warning: empty rule without %empty [-Wempty-rule] input.y:587.18: warning: empty rule without %empty [-Wempty-rule] input.y:591.18: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr] input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:1453" $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:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:128.18: warning: empty rule without %empty [-Wempty-rule] input.y:137.18: warning: empty rule without %empty [-Wempty-rule] input.y:142.18: warning: empty rule without %empty [-Wempty-rule] input.y:161.18: warning: empty rule without %empty [-Wempty-rule] input.y:179.18: warning: empty rule without %empty [-Wempty-rule] input.y:205.18: warning: empty rule without %empty [-Wempty-rule] input.y:213.18: warning: empty rule without %empty [-Wempty-rule] input.y:225.18: warning: empty rule without %empty [-Wempty-rule] input.y:292.18: warning: empty rule without %empty [-Wempty-rule] input.y:294.20: warning: empty rule without %empty [-Wempty-rule] input.y:367.18: warning: empty rule without %empty [-Wempty-rule] input.y:373.18: warning: empty rule without %empty [-Wempty-rule] input.y:387.18: warning: empty rule without %empty [-Wempty-rule] input.y:401.18: warning: empty rule without %empty [-Wempty-rule] input.y:413.18: warning: empty rule without %empty [-Wempty-rule] input.y:443.18: warning: empty rule without %empty [-Wempty-rule] input.y:471.18: warning: empty rule without %empty [-Wempty-rule] input.y:474.18: warning: empty rule without %empty [-Wempty-rule] input.y:489.18: warning: empty rule without %empty [-Wempty-rule] input.y:506.18: warning: empty rule without %empty [-Wempty-rule] input.y:587.18: warning: empty rule without %empty [-Wempty-rule] input.y:591.18: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr] input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:1453: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1453" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1453: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: 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:1453" ( $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:1453" $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:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $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:1453: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: grep '^State.*conflicts:' input.output" at_fn_check_prepare_trace "existing.at:1453" ( $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:1453" $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. $as_echo "existing.at:1453" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:1453" { set +x $as_echo "$at_srcdir/existing.at:1453: \$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:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:1453" ( $at_check_trace; 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:1453" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_501 #AT_START_502 at_fn_group_banner 502 'existing.at:1453' \ "GNU Cim Grammar: IELR(1)" " " 21 at_xfail=no ( $as_echo "502. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $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:1453: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:128.18: warning: empty rule without %empty [-Wempty-rule] input.y:137.18: warning: empty rule without %empty [-Wempty-rule] input.y:142.18: warning: empty rule without %empty [-Wempty-rule] input.y:161.18: warning: empty rule without %empty [-Wempty-rule] input.y:179.18: warning: empty rule without %empty [-Wempty-rule] input.y:205.18: warning: empty rule without %empty [-Wempty-rule] input.y:213.18: warning: empty rule without %empty [-Wempty-rule] input.y:225.18: warning: empty rule without %empty [-Wempty-rule] input.y:292.18: warning: empty rule without %empty [-Wempty-rule] input.y:294.20: warning: empty rule without %empty [-Wempty-rule] input.y:367.18: warning: empty rule without %empty [-Wempty-rule] input.y:373.18: warning: empty rule without %empty [-Wempty-rule] input.y:387.18: warning: empty rule without %empty [-Wempty-rule] input.y:401.18: warning: empty rule without %empty [-Wempty-rule] input.y:413.18: warning: empty rule without %empty [-Wempty-rule] input.y:443.18: warning: empty rule without %empty [-Wempty-rule] input.y:471.18: warning: empty rule without %empty [-Wempty-rule] input.y:474.18: warning: empty rule without %empty [-Wempty-rule] input.y:489.18: warning: empty rule without %empty [-Wempty-rule] input.y:506.18: warning: empty rule without %empty [-Wempty-rule] input.y:587.18: warning: empty rule without %empty [-Wempty-rule] input.y:591.18: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr] input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:1453" $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:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:128.18: warning: empty rule without %empty [-Wempty-rule] input.y:137.18: warning: empty rule without %empty [-Wempty-rule] input.y:142.18: warning: empty rule without %empty [-Wempty-rule] input.y:161.18: warning: empty rule without %empty [-Wempty-rule] input.y:179.18: warning: empty rule without %empty [-Wempty-rule] input.y:205.18: warning: empty rule without %empty [-Wempty-rule] input.y:213.18: warning: empty rule without %empty [-Wempty-rule] input.y:225.18: warning: empty rule without %empty [-Wempty-rule] input.y:292.18: warning: empty rule without %empty [-Wempty-rule] input.y:294.20: warning: empty rule without %empty [-Wempty-rule] input.y:367.18: warning: empty rule without %empty [-Wempty-rule] input.y:373.18: warning: empty rule without %empty [-Wempty-rule] input.y:387.18: warning: empty rule without %empty [-Wempty-rule] input.y:401.18: warning: empty rule without %empty [-Wempty-rule] input.y:413.18: warning: empty rule without %empty [-Wempty-rule] input.y:443.18: warning: empty rule without %empty [-Wempty-rule] input.y:471.18: warning: empty rule without %empty [-Wempty-rule] input.y:474.18: warning: empty rule without %empty [-Wempty-rule] input.y:489.18: warning: empty rule without %empty [-Wempty-rule] input.y:506.18: warning: empty rule without %empty [-Wempty-rule] input.y:587.18: warning: empty rule without %empty [-Wempty-rule] input.y:591.18: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr] input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:1453: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1453" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1453: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: 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:1453" ( $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:1453" $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:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $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:1453: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: grep '^State.*conflicts:' input.output" at_fn_check_prepare_trace "existing.at:1453" ( $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:1453" $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. $as_echo "existing.at:1453" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:1453" { set +x $as_echo "$at_srcdir/existing.at:1453: \$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:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:1453" ( $at_check_trace; 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:1453" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_502 #AT_START_503 at_fn_group_banner 503 'existing.at:1453' \ "GNU Cim Grammar: Canonical LR(1)" " " 21 at_xfail=no ( $as_echo "503. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:128.18: warning: empty rule without %empty [-Wempty-rule] input.y:137.18: warning: empty rule without %empty [-Wempty-rule] input.y:142.18: warning: empty rule without %empty [-Wempty-rule] input.y:161.18: warning: empty rule without %empty [-Wempty-rule] input.y:179.18: warning: empty rule without %empty [-Wempty-rule] input.y:205.18: warning: empty rule without %empty [-Wempty-rule] input.y:213.18: warning: empty rule without %empty [-Wempty-rule] input.y:225.18: warning: empty rule without %empty [-Wempty-rule] input.y:292.18: warning: empty rule without %empty [-Wempty-rule] input.y:294.20: warning: empty rule without %empty [-Wempty-rule] input.y:367.18: warning: empty rule without %empty [-Wempty-rule] input.y:373.18: warning: empty rule without %empty [-Wempty-rule] input.y:387.18: warning: empty rule without %empty [-Wempty-rule] input.y:401.18: warning: empty rule without %empty [-Wempty-rule] input.y:413.18: warning: empty rule without %empty [-Wempty-rule] input.y:443.18: warning: empty rule without %empty [-Wempty-rule] input.y:471.18: warning: empty rule without %empty [-Wempty-rule] input.y:474.18: warning: empty rule without %empty [-Wempty-rule] input.y:489.18: warning: empty rule without %empty [-Wempty-rule] input.y:506.18: warning: empty rule without %empty [-Wempty-rule] input.y:587.18: warning: empty rule without %empty [-Wempty-rule] input.y:591.18: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr] input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:1453" $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:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:128.18: warning: empty rule without %empty [-Wempty-rule] input.y:137.18: warning: empty rule without %empty [-Wempty-rule] input.y:142.18: warning: empty rule without %empty [-Wempty-rule] input.y:161.18: warning: empty rule without %empty [-Wempty-rule] input.y:179.18: warning: empty rule without %empty [-Wempty-rule] input.y:205.18: warning: empty rule without %empty [-Wempty-rule] input.y:213.18: warning: empty rule without %empty [-Wempty-rule] input.y:225.18: warning: empty rule without %empty [-Wempty-rule] input.y:292.18: warning: empty rule without %empty [-Wempty-rule] input.y:294.20: warning: empty rule without %empty [-Wempty-rule] input.y:367.18: warning: empty rule without %empty [-Wempty-rule] input.y:373.18: warning: empty rule without %empty [-Wempty-rule] input.y:387.18: warning: empty rule without %empty [-Wempty-rule] input.y:401.18: warning: empty rule without %empty [-Wempty-rule] input.y:413.18: warning: empty rule without %empty [-Wempty-rule] input.y:443.18: warning: empty rule without %empty [-Wempty-rule] input.y:471.18: warning: empty rule without %empty [-Wempty-rule] input.y:474.18: warning: empty rule without %empty [-Wempty-rule] input.y:489.18: warning: empty rule without %empty [-Wempty-rule] input.y:506.18: warning: empty rule without %empty [-Wempty-rule] input.y:587.18: warning: empty rule without %empty [-Wempty-rule] input.y:591.18: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 1876 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr] input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:1453: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:1453" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:1453" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:1453: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:1453" ( $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:1453" $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 $as_echo "existing.at:1453" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:1453" { set +x $as_echo "$at_srcdir/existing.at:1453: \$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:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:1453" ( $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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:1453: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:1453" ( $at_check_trace; 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:1453" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_503 #AT_START_504 at_fn_group_banner 504 'existing.at:3266' \ "GNU pic (Groff 1.18.1) Grammar: LALR(1)" " " 21 at_xfail=no ( $as_echo "504. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type lalr %define parse.error verbose %token LABEL %token VARIABLE %token NUMBER %token TEXT %token COMMAND_LINE %token DELIMITED %token ORDINAL %token TH %token LEFT_ARROW_HEAD %token RIGHT_ARROW_HEAD %token DOUBLE_ARROW_HEAD %token LAST %token UP %token DOWN %token LEFT %token RIGHT %token BOX %token CIRCLE %token ELLIPSE %token ARC %token LINE %token ARROW %token MOVE %token SPLINE %token HEIGHT %token RADIUS %token WIDTH %token DIAMETER %token FROM %token TO %token AT %token WITH %token BY %token THEN %token SOLID %token DOTTED %token DASHED %token CHOP %token SAME %token INVISIBLE %token LJUST %token RJUST %token ABOVE %token BELOW %token OF %token THE %token WAY %token BETWEEN %token AND %token HERE %token DOT_N %token DOT_E %token DOT_W %token DOT_S %token DOT_NE %token DOT_SE %token DOT_NW %token DOT_SW %token DOT_C %token DOT_START %token DOT_END %token DOT_X %token DOT_Y %token DOT_HT %token DOT_WID %token DOT_RAD %token SIN %token COS %token ATAN2 %token LOG %token EXP %token SQRT %token K_MAX %token K_MIN %token INT %token RAND %token SRAND %token COPY %token THROUGH %token TOP %token BOTTOM %token UPPER %token LOWER %token SH %token PRINT %token CW %token CCW %token FOR %token DO %token IF %token ELSE %token ANDAND %token OROR %token NOTEQUAL %token EQUALEQUAL %token LESSEQUAL %token GREATEREQUAL %token LEFT_CORNER %token RIGHT_CORNER %token NORTH %token SOUTH %token EAST %token WEST %token CENTER %token END %token START %token RESET %token UNTIL %token PLOT %token THICKNESS %token FILL %token COLORED %token OUTLINED %token SHADED %token ALIGNED %token SPRINTF %token COMMAND %left '.' /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */ %left PLOT %left TEXT SPRINTF /* give text adjustments higher precedence than TEXT, so that box "foo" above ljust == box ("foo" above ljust) */ %left LJUST RJUST ABOVE BELOW %left LEFT RIGHT /* Give attributes that take an optional expression a higher precedence than left and right, so that eg 'line chop left' parses properly. */ %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED %left LABEL %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST %left ORDINAL HERE '`' %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */ /* these need to be lower than '-' */ %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS /* these must have higher precedence than CHOP so that 'label %prec CHOP' works */ %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END %left ',' %left OROR %left ANDAND %left EQUALEQUAL NOTEQUAL %left '<' '>' LESSEQUAL GREATEREQUAL %left BETWEEN OF %left AND %left '+' '-' %left '*' '/' '%' %right '!' %right '^' %% top: optional_separator | element_list ; element_list: optional_separator middle_element_list optional_separator ; middle_element_list: element | middle_element_list separator element ; optional_separator: /* empty */ | separator ; separator: ';' | separator ';' ; placeless_element: VARIABLE '=' any_expr | VARIABLE ':' '=' any_expr | UP | DOWN | LEFT | RIGHT | COMMAND_LINE | COMMAND print_args | PRINT print_args | SH {} DELIMITED | COPY TEXT | COPY TEXT THROUGH {} DELIMITED {} until | COPY THROUGH {} DELIMITED {} until | FOR VARIABLE '=' expr TO expr optional_by DO {} DELIMITED | simple_if | simple_if ELSE {} DELIMITED | reset_variables | RESET ; reset_variables: RESET VARIABLE | reset_variables VARIABLE | reset_variables ',' VARIABLE ; print_args: print_arg | print_args print_arg ; print_arg: expr %prec ',' | text | position %prec ',' ; simple_if: IF any_expr THEN {} DELIMITED ; until: /* empty */ | UNTIL TEXT ; any_expr: expr | text_expr ; text_expr: text EQUALEQUAL text | text NOTEQUAL text | text_expr ANDAND text_expr | text_expr ANDAND expr | expr ANDAND text_expr | text_expr OROR text_expr | text_expr OROR expr | expr OROR text_expr | '!' text_expr ; optional_by: /* empty */ | BY expr | BY '*' expr ; element: object_spec | LABEL ':' optional_separator element | LABEL ':' optional_separator position_not_place | LABEL ':' optional_separator place | '{' {} element_list '}' {} optional_element | placeless_element ; optional_element: /* empty */ | element ; object_spec: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | MOVE | SPLINE | text %prec TEXT | PLOT expr | PLOT expr text | '[' {} element_list ']' | object_spec HEIGHT expr | object_spec RADIUS expr | object_spec WIDTH expr | object_spec DIAMETER expr | object_spec expr %prec HEIGHT | object_spec UP | object_spec UP expr | object_spec DOWN | object_spec DOWN expr | object_spec RIGHT | object_spec RIGHT expr | object_spec LEFT | object_spec LEFT expr | object_spec FROM position | object_spec TO position | object_spec AT position | object_spec WITH path | object_spec WITH position %prec ',' | object_spec BY expr_pair | object_spec THEN | object_spec SOLID | object_spec DOTTED | object_spec DOTTED expr | object_spec DASHED | object_spec DASHED expr | object_spec FILL | object_spec FILL expr | object_spec SHADED text | object_spec COLORED text | object_spec OUTLINED text | object_spec CHOP | object_spec CHOP expr | object_spec SAME | object_spec INVISIBLE | object_spec LEFT_ARROW_HEAD | object_spec RIGHT_ARROW_HEAD | object_spec DOUBLE_ARROW_HEAD | object_spec CW | object_spec CCW | object_spec text %prec TEXT | object_spec LJUST | object_spec RJUST | object_spec ABOVE | object_spec BELOW | object_spec THICKNESS expr | object_spec ALIGNED ; text: TEXT | SPRINTF '(' TEXT sprintf_args ')' ; sprintf_args: /* empty */ | sprintf_args ',' expr ; position: position_not_place | place ; position_not_place: expr_pair | position '+' expr_pair | position '-' expr_pair | '(' position ',' position ')' | expr between position AND position | expr '<' position ',' position '>' ; between: BETWEEN | OF THE WAY BETWEEN ; expr_pair: expr ',' expr | '(' expr_pair ')' ; place: /* line at A left == line (at A) left */ label %prec CHOP | label corner | corner label | corner OF label | HERE ; label: LABEL | nth_primitive | label '.' LABEL ; ordinal: ORDINAL | '`' any_expr TH ; optional_ordinal_last: LAST | ordinal LAST ; nth_primitive: ordinal object_type | optional_ordinal_last object_type ; object_type: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | SPLINE | '[' ']' | TEXT ; label_path: '.' LABEL | label_path '.' LABEL ; relative_path: corner %prec CHOP /* give this a lower precedence than LEFT and RIGHT so that [A: box] with .A left == [A: box] with (.A left) */ | label_path %prec TEXT | label_path corner ; path: relative_path | '(' relative_path ',' relative_path ')' {} /* The rest of these rules are a compatibility sop. */ | ORDINAL LAST object_type relative_path | LAST object_type relative_path | ORDINAL object_type relative_path | LABEL relative_path ; corner: DOT_N | DOT_E | DOT_W | DOT_S | DOT_NE | DOT_SE | DOT_NW | DOT_SW | DOT_C | DOT_START | DOT_END | TOP | BOTTOM | LEFT | RIGHT | UPPER LEFT | LOWER LEFT | UPPER RIGHT | LOWER RIGHT | LEFT_CORNER | RIGHT_CORNER | UPPER LEFT_CORNER | LOWER LEFT_CORNER | UPPER RIGHT_CORNER | LOWER RIGHT_CORNER | NORTH | SOUTH | EAST | WEST | CENTER | START | END ; expr: VARIABLE | NUMBER | place DOT_X | place DOT_Y | place DOT_HT | place DOT_WID | place DOT_RAD | expr '+' expr | expr '-' expr | expr '*' expr | expr '/' expr | expr '%' expr | expr '^' expr | '-' expr %prec '!' | '(' any_expr ')' | SIN '(' any_expr ')' | COS '(' any_expr ')' | ATAN2 '(' any_expr ',' any_expr ')' | LOG '(' any_expr ')' | EXP '(' any_expr ')' | SQRT '(' any_expr ')' | K_MAX '(' any_expr ',' any_expr ')' | K_MIN '(' any_expr ',' any_expr ')' | INT '(' any_expr ')' | RAND '(' any_expr ')' | RAND '(' ')' | SRAND '(' any_expr ')' | expr '<' expr | expr LESSEQUAL expr | expr '>' expr | expr GREATEREQUAL expr | expr EQUALEQUAL expr | expr NOTEQUAL expr | expr ANDAND expr | expr OROR expr | '!' expr ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { VARIABLE, '=', LABEL, LEFT, DOT_X, 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:3266: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:3266" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:3266: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:3266" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $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:3266: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:202.20: warning: empty rule without %empty [-Wempty-rule] input.y:270.7: warning: empty rule without %empty [-Wempty-rule] input.y:292.13: warning: empty rule without %empty [-Wempty-rule] input.y:309.18: warning: empty rule without %empty [-Wempty-rule] input.y:382.14: warning: empty rule without %empty [-Wempty-rule] input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:3266" $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:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:202.20: warning: empty rule without %empty [-Wempty-rule] input.y:270.7: warning: empty rule without %empty [-Wempty-rule] input.y:292.13: warning: empty rule without %empty [-Wempty-rule] input.y:309.18: warning: empty rule without %empty [-Wempty-rule] input.y:382.14: warning: empty rule without %empty [-Wempty-rule] input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:3266: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:3266" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:3266: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: 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:3266" ( $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:3266" $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:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:3266: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:3266" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:3266: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:3266" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $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:3266: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3266" ( $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:3266" $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. $as_echo "existing.at:3266" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:3266" { set +x $as_echo "$at_srcdir/existing.at:3266: \$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:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:3266" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:3266" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_504 #AT_START_505 at_fn_group_banner 505 'existing.at:3266' \ "GNU pic (Groff 1.18.1) Grammar: IELR(1)" " " 21 at_xfail=no ( $as_echo "505. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type ielr %define parse.error verbose %token LABEL %token VARIABLE %token NUMBER %token TEXT %token COMMAND_LINE %token DELIMITED %token ORDINAL %token TH %token LEFT_ARROW_HEAD %token RIGHT_ARROW_HEAD %token DOUBLE_ARROW_HEAD %token LAST %token UP %token DOWN %token LEFT %token RIGHT %token BOX %token CIRCLE %token ELLIPSE %token ARC %token LINE %token ARROW %token MOVE %token SPLINE %token HEIGHT %token RADIUS %token WIDTH %token DIAMETER %token FROM %token TO %token AT %token WITH %token BY %token THEN %token SOLID %token DOTTED %token DASHED %token CHOP %token SAME %token INVISIBLE %token LJUST %token RJUST %token ABOVE %token BELOW %token OF %token THE %token WAY %token BETWEEN %token AND %token HERE %token DOT_N %token DOT_E %token DOT_W %token DOT_S %token DOT_NE %token DOT_SE %token DOT_NW %token DOT_SW %token DOT_C %token DOT_START %token DOT_END %token DOT_X %token DOT_Y %token DOT_HT %token DOT_WID %token DOT_RAD %token SIN %token COS %token ATAN2 %token LOG %token EXP %token SQRT %token K_MAX %token K_MIN %token INT %token RAND %token SRAND %token COPY %token THROUGH %token TOP %token BOTTOM %token UPPER %token LOWER %token SH %token PRINT %token CW %token CCW %token FOR %token DO %token IF %token ELSE %token ANDAND %token OROR %token NOTEQUAL %token EQUALEQUAL %token LESSEQUAL %token GREATEREQUAL %token LEFT_CORNER %token RIGHT_CORNER %token NORTH %token SOUTH %token EAST %token WEST %token CENTER %token END %token START %token RESET %token UNTIL %token PLOT %token THICKNESS %token FILL %token COLORED %token OUTLINED %token SHADED %token ALIGNED %token SPRINTF %token COMMAND %left '.' /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */ %left PLOT %left TEXT SPRINTF /* give text adjustments higher precedence than TEXT, so that box "foo" above ljust == box ("foo" above ljust) */ %left LJUST RJUST ABOVE BELOW %left LEFT RIGHT /* Give attributes that take an optional expression a higher precedence than left and right, so that eg 'line chop left' parses properly. */ %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED %left LABEL %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST %left ORDINAL HERE '`' %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */ /* these need to be lower than '-' */ %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS /* these must have higher precedence than CHOP so that 'label %prec CHOP' works */ %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END %left ',' %left OROR %left ANDAND %left EQUALEQUAL NOTEQUAL %left '<' '>' LESSEQUAL GREATEREQUAL %left BETWEEN OF %left AND %left '+' '-' %left '*' '/' '%' %right '!' %right '^' %% top: optional_separator | element_list ; element_list: optional_separator middle_element_list optional_separator ; middle_element_list: element | middle_element_list separator element ; optional_separator: /* empty */ | separator ; separator: ';' | separator ';' ; placeless_element: VARIABLE '=' any_expr | VARIABLE ':' '=' any_expr | UP | DOWN | LEFT | RIGHT | COMMAND_LINE | COMMAND print_args | PRINT print_args | SH {} DELIMITED | COPY TEXT | COPY TEXT THROUGH {} DELIMITED {} until | COPY THROUGH {} DELIMITED {} until | FOR VARIABLE '=' expr TO expr optional_by DO {} DELIMITED | simple_if | simple_if ELSE {} DELIMITED | reset_variables | RESET ; reset_variables: RESET VARIABLE | reset_variables VARIABLE | reset_variables ',' VARIABLE ; print_args: print_arg | print_args print_arg ; print_arg: expr %prec ',' | text | position %prec ',' ; simple_if: IF any_expr THEN {} DELIMITED ; until: /* empty */ | UNTIL TEXT ; any_expr: expr | text_expr ; text_expr: text EQUALEQUAL text | text NOTEQUAL text | text_expr ANDAND text_expr | text_expr ANDAND expr | expr ANDAND text_expr | text_expr OROR text_expr | text_expr OROR expr | expr OROR text_expr | '!' text_expr ; optional_by: /* empty */ | BY expr | BY '*' expr ; element: object_spec | LABEL ':' optional_separator element | LABEL ':' optional_separator position_not_place | LABEL ':' optional_separator place | '{' {} element_list '}' {} optional_element | placeless_element ; optional_element: /* empty */ | element ; object_spec: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | MOVE | SPLINE | text %prec TEXT | PLOT expr | PLOT expr text | '[' {} element_list ']' | object_spec HEIGHT expr | object_spec RADIUS expr | object_spec WIDTH expr | object_spec DIAMETER expr | object_spec expr %prec HEIGHT | object_spec UP | object_spec UP expr | object_spec DOWN | object_spec DOWN expr | object_spec RIGHT | object_spec RIGHT expr | object_spec LEFT | object_spec LEFT expr | object_spec FROM position | object_spec TO position | object_spec AT position | object_spec WITH path | object_spec WITH position %prec ',' | object_spec BY expr_pair | object_spec THEN | object_spec SOLID | object_spec DOTTED | object_spec DOTTED expr | object_spec DASHED | object_spec DASHED expr | object_spec FILL | object_spec FILL expr | object_spec SHADED text | object_spec COLORED text | object_spec OUTLINED text | object_spec CHOP | object_spec CHOP expr | object_spec SAME | object_spec INVISIBLE | object_spec LEFT_ARROW_HEAD | object_spec RIGHT_ARROW_HEAD | object_spec DOUBLE_ARROW_HEAD | object_spec CW | object_spec CCW | object_spec text %prec TEXT | object_spec LJUST | object_spec RJUST | object_spec ABOVE | object_spec BELOW | object_spec THICKNESS expr | object_spec ALIGNED ; text: TEXT | SPRINTF '(' TEXT sprintf_args ')' ; sprintf_args: /* empty */ | sprintf_args ',' expr ; position: position_not_place | place ; position_not_place: expr_pair | position '+' expr_pair | position '-' expr_pair | '(' position ',' position ')' | expr between position AND position | expr '<' position ',' position '>' ; between: BETWEEN | OF THE WAY BETWEEN ; expr_pair: expr ',' expr | '(' expr_pair ')' ; place: /* line at A left == line (at A) left */ label %prec CHOP | label corner | corner label | corner OF label | HERE ; label: LABEL | nth_primitive | label '.' LABEL ; ordinal: ORDINAL | '`' any_expr TH ; optional_ordinal_last: LAST | ordinal LAST ; nth_primitive: ordinal object_type | optional_ordinal_last object_type ; object_type: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | SPLINE | '[' ']' | TEXT ; label_path: '.' LABEL | label_path '.' LABEL ; relative_path: corner %prec CHOP /* give this a lower precedence than LEFT and RIGHT so that [A: box] with .A left == [A: box] with (.A left) */ | label_path %prec TEXT | label_path corner ; path: relative_path | '(' relative_path ',' relative_path ')' {} /* The rest of these rules are a compatibility sop. */ | ORDINAL LAST object_type relative_path | LAST object_type relative_path | ORDINAL object_type relative_path | LABEL relative_path ; corner: DOT_N | DOT_E | DOT_W | DOT_S | DOT_NE | DOT_SE | DOT_NW | DOT_SW | DOT_C | DOT_START | DOT_END | TOP | BOTTOM | LEFT | RIGHT | UPPER LEFT | LOWER LEFT | UPPER RIGHT | LOWER RIGHT | LEFT_CORNER | RIGHT_CORNER | UPPER LEFT_CORNER | LOWER LEFT_CORNER | UPPER RIGHT_CORNER | LOWER RIGHT_CORNER | NORTH | SOUTH | EAST | WEST | CENTER | START | END ; expr: VARIABLE | NUMBER | place DOT_X | place DOT_Y | place DOT_HT | place DOT_WID | place DOT_RAD | expr '+' expr | expr '-' expr | expr '*' expr | expr '/' expr | expr '%' expr | expr '^' expr | '-' expr %prec '!' | '(' any_expr ')' | SIN '(' any_expr ')' | COS '(' any_expr ')' | ATAN2 '(' any_expr ',' any_expr ')' | LOG '(' any_expr ')' | EXP '(' any_expr ')' | SQRT '(' any_expr ')' | K_MAX '(' any_expr ',' any_expr ')' | K_MIN '(' any_expr ',' any_expr ')' | INT '(' any_expr ')' | RAND '(' any_expr ')' | RAND '(' ')' | SRAND '(' any_expr ')' | expr '<' expr | expr LESSEQUAL expr | expr '>' expr | expr GREATEREQUAL expr | expr EQUALEQUAL expr | expr NOTEQUAL expr | expr ANDAND expr | expr OROR expr | '!' expr ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { VARIABLE, '=', LABEL, LEFT, DOT_X, 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:3266: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:3266" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:3266: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:3266" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $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:3266: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:202.20: warning: empty rule without %empty [-Wempty-rule] input.y:270.7: warning: empty rule without %empty [-Wempty-rule] input.y:292.13: warning: empty rule without %empty [-Wempty-rule] input.y:309.18: warning: empty rule without %empty [-Wempty-rule] input.y:382.14: warning: empty rule without %empty [-Wempty-rule] input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:3266" $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:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:202.20: warning: empty rule without %empty [-Wempty-rule] input.y:270.7: warning: empty rule without %empty [-Wempty-rule] input.y:292.13: warning: empty rule without %empty [-Wempty-rule] input.y:309.18: warning: empty rule without %empty [-Wempty-rule] input.y:382.14: warning: empty rule without %empty [-Wempty-rule] input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:3266: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:3266" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:3266: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: diff -u /dev/null /dev/null || exit 77" at_fn_check_prepare_trace "existing.at:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: 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:3266" ( $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:3266" $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:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all input-lalr.y" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/existing.at:3266: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:3266" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/existing.at:3266: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:3266" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $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:3266: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y" at_fn_check_prepare_trace "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input-lalr.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: diff -u input-lalr.output input.output \\ | sed -n '/^@@/,\$p' | sed 's/^ \$//'" at_fn_check_prepare_notrace 'an embedded newline' "existing.at:3266" ( $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 "@@ -1249,7 +1249,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 @@ -1403,7 +1403,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 @@ -1880,7 +1880,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 @@ -2073,7 +2073,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 @@ -2597,7 +2597,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 @@ -2758,7 +2758,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 @@ -2901,7 +2901,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 @@ -3044,7 +3044,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 @@ -3282,7 +3282,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 @@ -3671,7 +3671,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 @@ -3830,7 +3830,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 @@ -4507,7 +4507,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 @@ -4699,7 +4699,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 @@ -4893,7 +4893,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 @@ -5091,7 +5091,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 @@ -5286,7 +5286,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 @@ -5429,7 +5429,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 @@ -5572,7 +5572,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 @@ -5715,7 +5715,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 @@ -6501,7 +6501,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 @@ -6659,7 +6659,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 @@ -6851,7 +6851,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 @@ -7043,7 +7043,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 @@ -7290,7 +7290,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 @@ -7434,7 +7434,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 @@ -7845,12 +7845,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 @@ -8013,7 +8013,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 @@ -8198,7 +8198,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 @@ -8359,7 +8359,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 @@ -8520,7 +8520,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 @@ -8681,7 +8681,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 @@ -8842,7 +8842,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 @@ -9003,7 +9003,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 @@ -9164,7 +9164,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 @@ -9325,7 +9325,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 @@ -9486,7 +9486,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 @@ -9649,7 +9649,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 @@ -9810,7 +9810,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 @@ -9947,7 +9947,7 @@ \$default reduce using rule 47 (any_expr) - between go to state 237 + between go to state 425 State 193 @@ -10178,7 +10178,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 @@ -10324,7 +10324,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 @@ -10648,7 +10648,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 @@ -10791,7 +10791,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 @@ -10934,7 +10934,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 @@ -11077,7 +11077,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 @@ -11220,7 +11220,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 @@ -11363,7 +11363,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 @@ -11506,7 +11506,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 @@ -11663,7 +11663,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 @@ -11806,7 +11806,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 @@ -11949,7 +11949,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 @@ -12092,7 +12092,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 @@ -12235,7 +12235,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 @@ -12378,7 +12378,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 @@ -12521,7 +12521,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 @@ -12664,7 +12664,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 @@ -12820,12 +12820,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 @@ -12963,7 +12963,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 @@ -13186,7 +13186,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 @@ -13345,7 +13345,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 @@ -13528,7 +13528,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 @@ -13687,7 +13687,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 @@ -13830,7 +13830,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 @@ -14773,7 +14773,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 @@ -15100,7 +15100,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 @@ -15719,12 +15719,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 @@ -16150,7 +16150,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). @@ -17260,7 +17260,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 @@ -17442,7 +17442,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 @@ -17603,7 +17603,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 @@ -17798,12 +17798,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 @@ -18097,7 +18097,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 @@ -18247,7 +18247,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 @@ -18856,7 +18856,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 @@ -19013,7 +19013,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 @@ -19115,3 +19115,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:3266" $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. $as_echo "existing.at:3266" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:3266" { set +x $as_echo "$at_srcdir/existing.at:3266: \$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:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:3266" ( $at_check_trace; 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:3266" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_505 #AT_START_506 at_fn_group_banner 506 'existing.at:3266' \ "GNU pic (Groff 1.18.1) Grammar: Canonical LR(1)" "" 21 at_xfail=no ( $as_echo "506. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define lr.type canonical-lr %define parse.error verbose %token LABEL %token VARIABLE %token NUMBER %token TEXT %token COMMAND_LINE %token DELIMITED %token ORDINAL %token TH %token LEFT_ARROW_HEAD %token RIGHT_ARROW_HEAD %token DOUBLE_ARROW_HEAD %token LAST %token UP %token DOWN %token LEFT %token RIGHT %token BOX %token CIRCLE %token ELLIPSE %token ARC %token LINE %token ARROW %token MOVE %token SPLINE %token HEIGHT %token RADIUS %token WIDTH %token DIAMETER %token FROM %token TO %token AT %token WITH %token BY %token THEN %token SOLID %token DOTTED %token DASHED %token CHOP %token SAME %token INVISIBLE %token LJUST %token RJUST %token ABOVE %token BELOW %token OF %token THE %token WAY %token BETWEEN %token AND %token HERE %token DOT_N %token DOT_E %token DOT_W %token DOT_S %token DOT_NE %token DOT_SE %token DOT_NW %token DOT_SW %token DOT_C %token DOT_START %token DOT_END %token DOT_X %token DOT_Y %token DOT_HT %token DOT_WID %token DOT_RAD %token SIN %token COS %token ATAN2 %token LOG %token EXP %token SQRT %token K_MAX %token K_MIN %token INT %token RAND %token SRAND %token COPY %token THROUGH %token TOP %token BOTTOM %token UPPER %token LOWER %token SH %token PRINT %token CW %token CCW %token FOR %token DO %token IF %token ELSE %token ANDAND %token OROR %token NOTEQUAL %token EQUALEQUAL %token LESSEQUAL %token GREATEREQUAL %token LEFT_CORNER %token RIGHT_CORNER %token NORTH %token SOUTH %token EAST %token WEST %token CENTER %token END %token START %token RESET %token UNTIL %token PLOT %token THICKNESS %token FILL %token COLORED %token OUTLINED %token SHADED %token ALIGNED %token SPRINTF %token COMMAND %left '.' /* this ensures that plot 17 "%g" parses as (plot 17 "%g") */ %left PLOT %left TEXT SPRINTF /* give text adjustments higher precedence than TEXT, so that box "foo" above ljust == box ("foo" above ljust) */ %left LJUST RJUST ABOVE BELOW %left LEFT RIGHT /* Give attributes that take an optional expression a higher precedence than left and right, so that eg 'line chop left' parses properly. */ %left CHOP SOLID DASHED DOTTED UP DOWN FILL COLORED OUTLINED %left LABEL %left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST %left ORDINAL HERE '`' %left BOX CIRCLE ELLIPSE ARC LINE ARROW SPLINE '[' /* ] */ /* these need to be lower than '-' */ %left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS /* these must have higher precedence than CHOP so that 'label %prec CHOP' works */ %left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C %left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER %left UPPER LOWER NORTH SOUTH EAST WEST CENTER START END %left ',' %left OROR %left ANDAND %left EQUALEQUAL NOTEQUAL %left '<' '>' LESSEQUAL GREATEREQUAL %left BETWEEN OF %left AND %left '+' '-' %left '*' '/' '%' %right '!' %right '^' %% top: optional_separator | element_list ; element_list: optional_separator middle_element_list optional_separator ; middle_element_list: element | middle_element_list separator element ; optional_separator: /* empty */ | separator ; separator: ';' | separator ';' ; placeless_element: VARIABLE '=' any_expr | VARIABLE ':' '=' any_expr | UP | DOWN | LEFT | RIGHT | COMMAND_LINE | COMMAND print_args | PRINT print_args | SH {} DELIMITED | COPY TEXT | COPY TEXT THROUGH {} DELIMITED {} until | COPY THROUGH {} DELIMITED {} until | FOR VARIABLE '=' expr TO expr optional_by DO {} DELIMITED | simple_if | simple_if ELSE {} DELIMITED | reset_variables | RESET ; reset_variables: RESET VARIABLE | reset_variables VARIABLE | reset_variables ',' VARIABLE ; print_args: print_arg | print_args print_arg ; print_arg: expr %prec ',' | text | position %prec ',' ; simple_if: IF any_expr THEN {} DELIMITED ; until: /* empty */ | UNTIL TEXT ; any_expr: expr | text_expr ; text_expr: text EQUALEQUAL text | text NOTEQUAL text | text_expr ANDAND text_expr | text_expr ANDAND expr | expr ANDAND text_expr | text_expr OROR text_expr | text_expr OROR expr | expr OROR text_expr | '!' text_expr ; optional_by: /* empty */ | BY expr | BY '*' expr ; element: object_spec | LABEL ':' optional_separator element | LABEL ':' optional_separator position_not_place | LABEL ':' optional_separator place | '{' {} element_list '}' {} optional_element | placeless_element ; optional_element: /* empty */ | element ; object_spec: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | MOVE | SPLINE | text %prec TEXT | PLOT expr | PLOT expr text | '[' {} element_list ']' | object_spec HEIGHT expr | object_spec RADIUS expr | object_spec WIDTH expr | object_spec DIAMETER expr | object_spec expr %prec HEIGHT | object_spec UP | object_spec UP expr | object_spec DOWN | object_spec DOWN expr | object_spec RIGHT | object_spec RIGHT expr | object_spec LEFT | object_spec LEFT expr | object_spec FROM position | object_spec TO position | object_spec AT position | object_spec WITH path | object_spec WITH position %prec ',' | object_spec BY expr_pair | object_spec THEN | object_spec SOLID | object_spec DOTTED | object_spec DOTTED expr | object_spec DASHED | object_spec DASHED expr | object_spec FILL | object_spec FILL expr | object_spec SHADED text | object_spec COLORED text | object_spec OUTLINED text | object_spec CHOP | object_spec CHOP expr | object_spec SAME | object_spec INVISIBLE | object_spec LEFT_ARROW_HEAD | object_spec RIGHT_ARROW_HEAD | object_spec DOUBLE_ARROW_HEAD | object_spec CW | object_spec CCW | object_spec text %prec TEXT | object_spec LJUST | object_spec RJUST | object_spec ABOVE | object_spec BELOW | object_spec THICKNESS expr | object_spec ALIGNED ; text: TEXT | SPRINTF '(' TEXT sprintf_args ')' ; sprintf_args: /* empty */ | sprintf_args ',' expr ; position: position_not_place | place ; position_not_place: expr_pair | position '+' expr_pair | position '-' expr_pair | '(' position ',' position ')' | expr between position AND position | expr '<' position ',' position '>' ; between: BETWEEN | OF THE WAY BETWEEN ; expr_pair: expr ',' expr | '(' expr_pair ')' ; place: /* line at A left == line (at A) left */ label %prec CHOP | label corner | corner label | corner OF label | HERE ; label: LABEL | nth_primitive | label '.' LABEL ; ordinal: ORDINAL | '`' any_expr TH ; optional_ordinal_last: LAST | ordinal LAST ; nth_primitive: ordinal object_type | optional_ordinal_last object_type ; object_type: BOX | CIRCLE | ELLIPSE | ARC | LINE | ARROW | SPLINE | '[' ']' | TEXT ; label_path: '.' LABEL | label_path '.' LABEL ; relative_path: corner %prec CHOP /* give this a lower precedence than LEFT and RIGHT so that [A: box] with .A left == [A: box] with (.A left) */ | label_path %prec TEXT | label_path corner ; path: relative_path | '(' relative_path ',' relative_path ')' {} /* The rest of these rules are a compatibility sop. */ | ORDINAL LAST object_type relative_path | LAST object_type relative_path | ORDINAL object_type relative_path | LABEL relative_path ; corner: DOT_N | DOT_E | DOT_W | DOT_S | DOT_NE | DOT_SE | DOT_NW | DOT_SW | DOT_C | DOT_START | DOT_END | TOP | BOTTOM | LEFT | RIGHT | UPPER LEFT | LOWER LEFT | UPPER RIGHT | LOWER RIGHT | LEFT_CORNER | RIGHT_CORNER | UPPER LEFT_CORNER | LOWER LEFT_CORNER | UPPER RIGHT_CORNER | LOWER RIGHT_CORNER | NORTH | SOUTH | EAST | WEST | CENTER | START | END ; expr: VARIABLE | NUMBER | place DOT_X | place DOT_Y | place DOT_HT | place DOT_WID | place DOT_RAD | expr '+' expr | expr '-' expr | expr '*' expr | expr '/' expr | expr '%' expr | expr '^' expr | '-' expr %prec '!' | '(' any_expr ')' | SIN '(' any_expr ')' | COS '(' any_expr ')' | ATAN2 '(' any_expr ',' any_expr ')' | LOG '(' any_expr ')' | EXP '(' any_expr ')' | SQRT '(' any_expr ')' | K_MAX '(' any_expr ',' any_expr ')' | K_MIN '(' any_expr ',' any_expr ')' | INT '(' any_expr ')' | RAND '(' any_expr ')' | RAND '(' ')' | SRAND '(' any_expr ')' | expr '<' expr | expr LESSEQUAL expr | expr '>' expr | expr GREATEREQUAL expr | expr EQUALEQUAL expr | expr NOTEQUAL expr | expr ANDAND expr | expr OROR expr | '!' expr ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int yylex (void) { static int const input[] = { VARIABLE, '=', LABEL, LEFT, DOT_X, 0 }; static int const *inputp = input; return *inputp++; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before # expanding macros, so it corrupts some special characters in the # macros. To avoid this, expand now and pass it the result with proper # string quotation. Assume args 7 through 12 expand to properly quoted # strings. { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y" at_fn_check_prepare_trace "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:202.20: warning: empty rule without %empty [-Wempty-rule] input.y:270.7: warning: empty rule without %empty [-Wempty-rule] input.y:292.13: warning: empty rule without %empty [-Wempty-rule] input.y:309.18: warning: empty rule without %empty [-Wempty-rule] input.y:382.14: warning: empty rule without %empty [-Wempty-rule] input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for '\`', use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] " | \ $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:3266" $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:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:202.20: warning: empty rule without %empty [-Wempty-rule] input.y:270.7: warning: empty rule without %empty [-Wempty-rule] input.y:292.13: warning: empty rule without %empty [-Wempty-rule] input.y:309.18: warning: empty rule without %empty [-Wempty-rule] input.y:382.14: warning: empty rule without %empty [-Wempty-rule] input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] input.y:159.1-5: warning: useless associativity for '[', use %precedence [-Wprecedence] input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/existing.at:3266: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "existing.at:3266" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/existing.at:3266" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none" "existing.at:3266" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all --defines -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:3266" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi { set +x $as_echo "$at_srcdir/existing.at:3266: sed -n 's/^State //p' input.output | tail -1" at_fn_check_prepare_notrace 'a shell pipeline' "existing.at:3266" ( $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:3266" $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 $as_echo "existing.at:3266" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/existing.at:3266" { set +x $as_echo "$at_srcdir/existing.at:3266: \$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:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "existing.at:3266" ( $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:3266" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/existing.at:3266: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "existing.at:3266" ( $at_check_trace; 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:3266" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_506 #AT_START_507 at_fn_group_banner 507 'regression.at:25' \ "Trivial grammars" " " 22 at_xfail=no ( $as_echo "507. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ void yyerror (const char *msg); int yylex (void); #define YYSTYPE int * %} %define parse.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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:43" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:43" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/regression.at:43: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:43" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:43" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:44" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:44" { 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; } $as_echo "regression.at:45" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:45" { 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_507 #AT_START_508 at_fn_group_banner 508 'regression.at:55' \ "YYSTYPE typedef" " " 22 at_xfail=no ( $as_echo "508. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ 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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:73" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:73" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/regression.at:73: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:73" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:73" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:74" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:74" { 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_508 #AT_START_509 at_fn_group_banner 509 'regression.at:85' \ "Early token definitions with --yacc" " " 22 at_xfail=no ( $as_echo "509. $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. # Not AT_DATA_GRAMMAR, which uses %code, which is not supported by Yacc. cat >input.y <<'_ATEOF' %{ 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:115: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -y -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:115" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:115" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:115: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -y -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -y -o input.c input.y" "regression.at:115" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -y -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:115" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:115: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:115" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:115" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:115: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:115" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:115" $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:115: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -y -o input.c input.y" at_fn_check_prepare_trace "regression.at:115" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -y -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:115" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:116" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:116" { set +x $as_echo "$at_srcdir/regression.at:116: \$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:116" ( $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: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_509 #AT_START_510 at_fn_group_banner 510 'regression.at:127' \ "Early token definitions without --yacc" " " 22 at_xfail=no ( $as_echo "510. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ void yyerror (const char *msg); int yylex (void); void print_my_token (void); %} %union { int val; }; %{ #include 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:160: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:160" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:160" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:160: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:160" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:160" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:160: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:160" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:160" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:160: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:160" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:160" $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:160: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:160" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:160" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:161" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:161" { set +x $as_echo "$at_srcdir/regression.at:161: \$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:161" ( $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: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_510 #AT_START_511 at_fn_group_banner 511 'regression.at:172' \ "Braces parsing" " " 22 at_xfail=no ( $as_echo "511. $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:184: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:184" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:184: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:184" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:184: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:184" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:184" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:184: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:184" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/regression.at:184: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y" at_fn_check_prepare_trace "regression.at:184" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:184" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:186: grep 'tests = {{{{{{{{{{}}}}}}}}}};' input.c" at_fn_check_prepare_trace "regression.at:186" ( $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: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_511 #AT_START_512 at_fn_group_banner 512 'regression.at:195' \ "Rule Line Numbers" " " 22 at_xfail=no ( $as_echo "512. $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:231: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c -v input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:231" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:231" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:231: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y" "regression.at:231" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:231" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:231: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:231" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:231" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:231: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:231" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/regression.at:231: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -v input.y" at_fn_check_prepare_trace "regression.at:231" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:231" $at_failed && at_fn_log_failure $at_traceon; } # Check the contents of the report. { set +x $as_echo "$at_srcdir/regression.at:333: cat input.output" at_fn_check_prepare_trace "regression.at:333" ( $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:333" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_512 #AT_START_513 at_fn_group_banner 513 'regression.at:344' \ "Mixing %token styles" " " 22 at_xfail=no ( $as_echo "513. $at_setup_line: testing $at_desc ..." $at_traceon # Taken from the documentation. cat >input.y <<'_ATEOF' %token OR "||" %token LE 134 "<=" %left OR "<=" %% exp: %empty; %% _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:359: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -v -Wall -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:359" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -v -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:359" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:359: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -Wall -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -Wall -o input.c input.y" "regression.at:359" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:359" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:359: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:359" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:359" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:359: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:359" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:359" $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:359: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -Wall -o input.c input.y" at_fn_check_prepare_trace "regression.at:359" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:3.1-5: warning: useless precedence and associativity for \"||\" [-Wprecedence] input.y:3.1-5: warning: useless precedence and associativity for \"<=\" [-Wprecedence] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:359" $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:359: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y -Werror" "regression.at:359" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:359" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:3.1-5: warning: useless precedence and associativity for "||" [-Wprecedence] input.y:3.1-5: warning: useless precedence and associativity for "<=" [-Wprecedence] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/regression.at:359: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:359" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:359" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/regression.at:359: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y --warnings=error" "regression.at:359" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:359" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/regression.at:359: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y -Wnone,none -Werror --trace=none" "regression.at:359" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:359" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:359: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror --trace=none" "regression.at:359" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -Wall -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:359" $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_513 #AT_START_514 at_fn_group_banner 514 'regression.at:370' \ "Token definitions" " " 22 at_xfail=no ( $as_echo "514. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include static void yyerror (const char *msg); static int yylex (void); %} %define parse.error verbose %token MYEOF 0 "end of file" %token 'a' "a" // Bison managed, when fed with '%token 'f' "f"' to #define 'f'! %token B_TOKEN "b" %token C_TOKEN 'c' %token 'd' D_TOKEN %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" %% exp: "a" "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { SPECIAL }; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF # Checking the warning message guarantees that the trigraph "??!" isn't # unnecessarily escaped here even though it would need to be if encoded in a # C-string literal. Also notice that unnecessary escaping, such as "\?", from # the user specification is eliminated. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:410: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:410" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:410" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:410: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "regression.at:410" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:410" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:410: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:410" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:410" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:410: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:410" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:410" $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:410: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o input.c input.y" at_fn_check_prepare_trace "regression.at:410" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother] 22 | %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\" | ^~~~~~~ input.y:21.8-14: previous declaration 21 | %token SPECIAL \"\\\\\\'\\?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\x001\\x000081??!\" | ^~~~~~~ input.y:22.16-63: warning: symbol \"\\\\'?\\\"\\a\\b\\f\\n\\r\\t\\v\\001\\201\\001\\201??!\" used more than once as a literal string [-Wother] 22 | %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:410" $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:410: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror" "regression.at:410" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:410" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother] 22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" | ^~~~~~~ input.y:21.8-14: previous declaration 21 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" | ^~~~~~~ input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother] 22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/regression.at:410: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:410" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:410" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/regression.at:410: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error" "regression.at:410" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:410" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/regression.at:410: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" "regression.at:410" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:410" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:410: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none" "regression.at:410" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:410" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "regression.at:412" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:412" { set +x $as_echo "$at_srcdir/regression.at:412: \$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:412" ( $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:412" $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:421: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.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/regression.at:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:421: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.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 $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:421" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_514 #AT_START_515 at_fn_group_banner 515 'regression.at:431' \ "Characters Escapes" " " 22 at_xfail=no ( $as_echo "515. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ 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:449: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:449" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:449" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:449: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:449" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:449" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:449: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:449" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:449" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:449: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:449" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/regression.at:449: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:449" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:449" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:450" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:450" { set +x $as_echo "$at_srcdir/regression.at:450: \$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:450" ( $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:450" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_515 #AT_START_516 at_fn_group_banner 516 'regression.at:464' \ "Web2c Report" " " 22 at_xfail=no ( $as_echo "516. $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:489: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -v input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:489" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:489" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:489: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v input.y" "regression.at:489" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:489" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:489: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:489" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:489" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:489: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:489" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:489" $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:489: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v input.y" at_fn_check_prepare_trace "regression.at:489" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:489" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:618: cat input.output" at_fn_check_prepare_trace "regression.at:618" ( $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: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_516 #AT_START_517 at_fn_group_banner 517 'regression.at:645' \ "Web2c Actions" " " 22 at_xfail=no ( $as_echo "517. $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:658: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -v -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:658" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:658" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:658: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "regression.at:658" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:658" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:658: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:658" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:658" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:658: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:658" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:658" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:658: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y" at_fn_check_prepare_trace "regression.at:658" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -v -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:658" $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:746: cat tables.c" at_fn_check_prepare_trace "regression.at:746" ( $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_int8 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_int8 yyrline[] = { 0, 2, 2, 3, 3, 4, 5 }; static const char *const yytname[] = { \"\$end\", \"error\", \"\$undefined\", \"\\\"if\\\"\", \"\\\"const\\\"\", \"\\\"then\\\"\", \"\\\"else\\\"\", \"\$accept\", \"statement\", \"struct_stat\", \"if\", \"else\", YY_NULLPTR }; static const yytype_int16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261 }; static const yytype_int8 yypact[] = { -2, -1, 4, -8, 0, 2, -8, -2, -8, -2, -8, -8 }; static const yytype_int8 yydefact[] = { 3, 0, 0, 2, 0, 0, 1, 3, 4, 3, 6, 5 }; static const yytype_int8 yypgoto[] = { -8, -7, -8, -8, -8 }; static const yytype_int8 yydefgoto[] = { -1, 2, 3, 4, 8 }; static const yytype_int8 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_int8 yystos[] = { 0, 3, 8, 9, 10, 4, 0, 6, 11, 5, 8, 8 }; static const yytype_int8 yyr1[] = { 0, 7, 8, 9, 9, 10, 11 }; static const yytype_int8 yyr2[] = { 0, 2, 1, 0, 2, 4, 2 }; " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:746" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_517 #AT_START_518 at_fn_group_banner 518 'regression.at:834' \ "Dancer " " " 22 at_xfail=no ( $as_echo "518. $at_setup_line: testing $at_desc ..." $at_traceon cat >dancer.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code provides { #include static void yyerror (const char *msg); static int yylex (void); } %token ARROW INVALID NUMBER STRING DATA %verbose %define parse.error verbose /* Grammar follows */ %% line: header body ; header: '<' from ARROW to '>' type ':' | '<' ARROW to '>' type ':' | ARROW to type ':' | type ':' | '<' '>' ; from: DATA | STRING | INVALID ; to: DATA | STRING | INVALID ; type: DATA | STRING | INVALID ; body: %empty | body member ; member: STRING | DATA | '+' NUMBER | '-' NUMBER | NUMBER | INVALID ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ":"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:834: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o dancer.c dancer.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:834" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:834" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:834: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:834" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:834" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:834: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:834" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:834" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:834: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:834" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:834" $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:834: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o dancer.c dancer.y" at_fn_check_prepare_trace "regression.at:834" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:834" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:834" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:834" { set +x $as_echo "$at_srcdir/regression.at:834: \$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:834" ( $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:834" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:834: \$PREPARSER ./dancer" at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:834" ( $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:834" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:834: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:834" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:834" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_518 #AT_START_519 at_fn_group_banner 519 'regression.at:835' \ "Dancer %glr-parser" " " 22 at_xfail=no ( $as_echo "519. $at_setup_line: testing $at_desc ..." $at_traceon cat >dancer.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code provides { #include static void yyerror (const char *msg); static int yylex (void); } %glr-parser %token ARROW INVALID NUMBER STRING DATA %verbose %define parse.error verbose /* Grammar follows */ %% line: header body ; header: '<' from ARROW to '>' type ':' | '<' ARROW to '>' type ':' | ARROW to type ':' | type ':' | '<' '>' ; from: DATA | STRING | INVALID ; to: DATA | STRING | INVALID ; type: DATA | STRING | INVALID ; body: %empty | body member ; member: STRING | DATA | '+' NUMBER | '-' NUMBER | NUMBER | INVALID ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ":"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:835: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o dancer.c dancer.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:835" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:835" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:835: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y" "regression.at:835" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:835" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:835: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:835" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:835" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:835: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:835" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:835" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:835: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o dancer.c dancer.y" at_fn_check_prepare_trace "regression.at:835" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o dancer.c dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:835" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:835" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:835" { set +x $as_echo "$at_srcdir/regression.at:835: \$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:835" ( $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:835" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:835: \$PREPARSER ./dancer" at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:835" ( $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:835" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:835: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:835" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:835" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_519 #AT_START_520 at_fn_group_banner 520 'regression.at:836' \ "Dancer lalr1.cc" " " 22 at_xfail=no ( $as_echo "520. $at_setup_line: testing $at_desc ..." $at_traceon cat >dancer.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code provides { static int yylex (yy::parser::semantic_type *lvalp); } %skeleton "lalr1.cc" %token ARROW INVALID NUMBER STRING DATA %verbose %define parse.error verbose /* Grammar follows */ %% line: header body ; header: '<' from ARROW to '>' type ':' | '<' ARROW to '>' type ':' | ARROW to type ':' | type ':' | '<' '>' ; from: DATA | STRING | INVALID ; to: DATA | STRING | INVALID ; type: DATA | STRING | INVALID ; body: %empty | body member ; member: STRING | DATA | '+' NUMBER | '-' NUMBER | NUMBER | INVALID ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = ":"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:836: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o dancer.cc dancer.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:836" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:836" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:836: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y" "regression.at:836" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o dancer.cc dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:836" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:836: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:836" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:836" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:836: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:836" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:836" $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:836: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o dancer.cc dancer.y" at_fn_check_prepare_trace "regression.at:836" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o dancer.cc dancer.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:836" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:836" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:836" { set +x $as_echo "$at_srcdir/regression.at:836: \$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:836" ( $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:836" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:836: \$PREPARSER ./dancer" at_fn_check_prepare_dynamic " $PREPARSER ./dancer" "regression.at:836" ( $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:836" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:836: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:836" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:836" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_520 #AT_START_521 at_fn_group_banner 521 'regression.at:911' \ "Expecting two tokens " " " 22 at_xfail=no ( $as_echo "521. $at_setup_line: testing $at_desc ..." $at_traceon cat >expect2.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ static int yylex (void); #include static void yyerror (const char *msg); %} %define parse.error verbose %token A 1000 %token B %% program: %empty | program e ';' | program error ';'; e: e '+' t | t; t: A | B; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const tokens[] = { 1000, '+', '+', -1 }; static size_t toknum; assert (toknum < sizeof tokens / sizeof *tokens); return tokens[toknum++]; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:911: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o expect2.c expect2.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:911" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:911" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:911: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:911" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:911" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:911: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:911" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:911" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:911: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:911" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:911" $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:911: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o expect2.c expect2.y" at_fn_check_prepare_trace "regression.at:911" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:911" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:911" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:911" { set +x $as_echo "$at_srcdir/regression.at:911: \$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:911" ( $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:911" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:911: \$PREPARSER ./expect2" at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:911" ( $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:911" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:911: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:911" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:911" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_521 #AT_START_522 at_fn_group_banner 522 'regression.at:912' \ "Expecting two tokens %glr-parser" " " 22 at_xfail=no ( $as_echo "522. $at_setup_line: testing $at_desc ..." $at_traceon cat >expect2.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ static int yylex (void); #include static void yyerror (const char *msg); %} %glr-parser %define parse.error verbose %token A 1000 %token B %% program: %empty | program e ';' | program error ';'; e: e '+' t | t; t: A | B; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const tokens[] = { 1000, '+', '+', -1 }; static size_t toknum; assert (toknum < sizeof tokens / sizeof *tokens); return tokens[toknum++]; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:912: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o expect2.c expect2.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:912" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:912: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y" "regression.at:912" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:912" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:912: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:912" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:912" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:912: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:912" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:912" $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:912: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o expect2.c expect2.y" at_fn_check_prepare_trace "regression.at:912" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o expect2.c expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:912" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:912" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:912" { set +x $as_echo "$at_srcdir/regression.at:912: \$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:912" ( $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:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:912: \$PREPARSER ./expect2" at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:912" ( $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:912" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:912: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:912" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:912" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_522 #AT_START_523 at_fn_group_banner 523 'regression.at:913' \ "Expecting two tokens lalr1.cc" " " 22 at_xfail=no ( $as_echo "523. $at_setup_line: testing $at_desc ..." $at_traceon cat >expect2.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ static int yylex (int *); #include %} %skeleton "lalr1.cc" %define parse.error verbose %token A 1000 %token B %% program: %empty | program e ';' | program error ';'; e: e '+' t | t; t: A | B; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } 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++]; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:913: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o expect2.cc expect2.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:913" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:913" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:913: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y" "regression.at:913" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o expect2.cc expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:913" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:913: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:913" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:913" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:913: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:913" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:913" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:913: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o expect2.cc expect2.y" at_fn_check_prepare_trace "regression.at:913" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o expect2.cc expect2.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:913" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:913" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:913" { set +x $as_echo "$at_srcdir/regression.at:913: \$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:913" ( $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:913" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:913: \$PREPARSER ./expect2" at_fn_check_prepare_dynamic " $PREPARSER ./expect2" "regression.at:913" ( $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:913" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:913: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:913" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:913" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_523 #AT_START_524 at_fn_group_banner 524 'regression.at:921' \ "Braced code in declaration in rules section" " " 22 at_xfail=no ( $as_echo "524. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include static void yyerror (const char *msg); static int yylex (void); %} %debug %define parse.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 (yyo, "PRINTER"); } 'a'; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:952: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:952" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:952" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:952: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:952" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:952" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:952: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:952" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:952" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:952: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:952" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:952" $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:952: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:952" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:952" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:953" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:953" { set +x $as_echo "$at_srcdir/regression.at:953: \$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:953" ( $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:953" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:970: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:970" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "Bison would once convert this action to a midrule because of the subsequent braced code. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:970" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:970: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:970" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:970" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_524 #AT_START_525 at_fn_group_banner 525 'regression.at:980' \ "String alias declared after use" " " 22 at_xfail=no ( $as_echo "525. $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:993: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:993" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:993" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:993: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:993" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:993" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:993: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:993" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:993" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:993: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:993" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:993" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:993: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:993" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:993" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_525 #AT_START_526 at_fn_group_banner 526 'regression.at:1003' \ "Extra lookahead sets in report" " " 22 at_xfail=no ( $as_echo "526. $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:1018: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv --report=all input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1018" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv --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:1018" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1018: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y" "regression.at:1018" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1018" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1018: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1018" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1018" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1018: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1018" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1018" $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:1018: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input.y" at_fn_check_prepare_trace "regression.at:1018" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret --report=all input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1018" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1034: 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:1034" ( $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:1034" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_526 #AT_START_527 at_fn_group_banner 527 'regression.at:1044' \ "Token number in precedence declaration" " " 22 at_xfail=no ( $as_echo "527. $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); } %define parse.error verbose %token TK_ALIAS 3 "tok alias" %right END 0 %left TK1 1 TK2 2 "tok alias" %% start: TK1 sr_conflict "tok alias" | start %prec END ; sr_conflict: TK2 | TK2 "tok alias" ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static int const input[] = { 1, 2, 3, 0 }; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1081: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wall -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1081" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1081" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1081: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" "regression.at:1081" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1081" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1081: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1081" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1081" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1081: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1081" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1081" $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:1081: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall -o input.c input.y" at_fn_check_prepare_trace "regression.at:1081" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wall -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:24.5-19: warning: rule useless in parser due to conflicts [-Wother] input.y:28.5-19: warning: rule useless in parser due to conflicts [-Wother] input.y:18.1-5: warning: useless precedence and associativity for TK1 [-Wprecedence] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1081" $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:1081: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror" "regression.at:1081" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1081" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y:24.5-19: warning: rule useless in parser due to conflicts [-Wother] input.y:28.5-19: warning: rule useless in parser due to conflicts [-Wother] input.y:18.1-5: warning: useless precedence and associativity for TK1 [-Wprecedence] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/regression.at:1081: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "regression.at:1081" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1081" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/regression.at:1081: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error" "regression.at:1081" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1081" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/regression.at:1081: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none" "regression.at:1081" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1081" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1081: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none" "regression.at:1081" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1081" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "regression.at:1082" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1082" { set +x $as_echo "$at_srcdir/regression.at:1082: \$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:1082" ( $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:1082" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1083: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1083" ( $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:1083" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1083: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1083" ( $at_check_trace; 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:1083" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_527 #AT_START_528 at_fn_group_banner 528 'regression.at:1097' \ "parse-gram.y: LALR = IELR" " " 22 at_xfail=no ( $as_echo "528. $at_setup_line: testing $at_desc ..." $at_traceon # Avoid tests/bison's dark magic by processing a local copy of the # grammar. Avoid differences in synclines by telling bison that the # output files have the same name. cp $abs_top_srcdir/src/parse-gram.y input.y if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1103: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c -Dlr.type=lalr input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1103" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1103" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1103: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y" "regression.at:1103" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=lalr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1103" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1103: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1103" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1103" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1103: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1103" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1103" $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:1103: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -Dlr.type=lalr input.y" at_fn_check_prepare_trace "regression.at:1103" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -Dlr.type=lalr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1103" $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:1106: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c -Dlr.type=ielr input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1106" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1106" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1106: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y" "regression.at:1106" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -Dlr.type=ielr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1106" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1106: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1106" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1106" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1106: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1106" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1106" $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:1106: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -Dlr.type=ielr input.y" at_fn_check_prepare_trace "regression.at:1106" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c -Dlr.type=ielr input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1106" $at_failed && at_fn_log_failure \ "lalr.c" $at_traceon; } mv input.c ielr.c { set +x $as_echo "$at_srcdir/regression.at:1109: diff lalr.c ielr.c" at_fn_check_prepare_trace "regression.at:1109" ( $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:1109" $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_528 #AT_START_529 at_fn_group_banner 529 'regression.at:1119' \ "parse.error=verbose and YYSTACK_USE_ALLOCA" " " 22 at_xfail=no ( $as_echo "529. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); #define YYSTACK_USE_ALLOCA 1 } %define parse.error verbose %% start: check syntax_error syntax_error ; check: { if (128 < sizeof yymsgbuf) { fprintf (stderr, "The initial size of yymsgbuf in yyparse has increased\n" "since this test group was last updated. As a result,\n" "this test group may no longer manage to induce a\n" "reallocation of the syntax error message buffer.\n" "This test group must be adjusted to produce a longer\n" "error message.\n"); YYABORT; } } ; // Induce a syntax error message whose total length is more than // sizeof yymsgbuf in yyparse. Each token here is 64 bytes. syntax_error: "123456789112345678921234567893123456789412345678951234567896123A" | "123456789112345678921234567893123456789412345678951234567896123B" | error 'a' 'b' 'c' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /* Induce two syntax error messages (which requires full error recovery by shifting 3 tokens) in order to detect any loss of the reallocated buffer. */ #include static int yylex (void) { static char const input[] = "abc"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1170: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1170" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1170" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1170: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1170" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1170" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1170: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1170" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1170" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1170: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1170" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1170" $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:1170: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:1170" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1170" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1171" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1171" { set +x $as_echo "$at_srcdir/regression.at:1171: \$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:1171" ( $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:1171" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1175: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1175" ( $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:1175" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1175: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1175" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1175" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_529 #AT_START_530 at_fn_group_banner 530 'regression.at:1193' \ "parse.error=verbose overflow" " " 22 at_xfail=no ( $as_echo "530. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %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 } %define parse.error verbose %% start: syntax_error1 check syntax_error2 ; // Induce a syntax error message whose total length causes yymsg in // yyparse to be reallocated to size YYSTACK_ALLOC_MAXIMUM, which // should be 255. Each token here is 64 bytes. syntax_error1: "123456789112345678921234567893123456789412345678951234567896123A" | "123456789112345678921234567893123456789412345678951234567896123B" | "123456789112345678921234567893123456789412345678951234567896123C" | error 'a' 'b' 'c' ; check: { if (yymsg_alloc != YYSTACK_ALLOC_MAXIMUM || YYSTACK_ALLOC_MAXIMUM != YYSIZE_MAXIMUM || YYSIZE_MAXIMUM != 255) { fprintf (stderr, "The assumptions of this test group are no longer\n" "valid, so it may no longer catch the error it was\n" "designed to catch. Specifically, the following\n" "values should all be 255:\n\n"); fprintf (stderr, " yymsg_alloc = %d\n", yymsg_alloc); fprintf (stderr, " YYSTACK_ALLOC_MAXIMUM = %d\n", YYSTACK_ALLOC_MAXIMUM); fprintf (stderr, " YYSIZE_MAXIMUM = %d\n", YYSIZE_MAXIMUM); YYABORT; } } ; // Now overflow. syntax_error2: "123456789112345678921234567893123456789412345678951234567896123A" | "123456789112345678921234567893123456789412345678951234567896123B" | "123456789112345678921234567893123456789412345678951234567896123C" | "123456789112345678921234567893123456789412345678951234567896123D" | "123456789112345678921234567893123456789412345678951234567896123E" ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } /* Induce two syntax error messages (which requires full error recovery by shifting 3 tokens). */ #include static int yylex (void) { static char const input[] = "abc"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:1280: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1280" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1280" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1280: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1280" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1280" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1280: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1280" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1280" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1280: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1280" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1280" $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:1280: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:1280" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1280" $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" $as_echo "regression.at:1287" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1287" { set +x $as_echo "$at_srcdir/regression.at:1287: \$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:1287" ( $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:1287" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1293: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1293" ( $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:1293" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1293: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1293" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1293" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_530 #AT_START_531 at_fn_group_banner 531 'regression.at:1303' \ "LAC: Exploratory stack" " " 22 at_xfail=no ( $as_echo "531. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include /* printf */ #include static void yyerror (const char *msg); static int yylex (void); } %debug %define api.push-pull pull %define parse.error verbose %token 'c' %expect 21 %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | %empty { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: %empty { printf ("consistent default reduction\n"); } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "bbbbc"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1372: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1372: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1372" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1372: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1372" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1372" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1372: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1372" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1372" $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:1372: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1372" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1372" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1372" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1372" { set +x $as_echo "$at_srcdir/regression.at:1372: \$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:1372" ( $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:1372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1372: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1372" ( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1372" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1372" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1372" $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:1372: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1372" ( $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:1372" $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. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1372: \"\$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" "regression.at:1372" ( $at_check_trace; "$PERL" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.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 "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1372" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1372: \"\$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" "regression.at:1372" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\bconsistent default reduction//g;' stdout.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 "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1372" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1372: \"\$PERL\" -0777 -ne 'print s/\\(realloc//g;' < stderr.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\(realloc//g;' < stderr.txt" "regression.at:1372" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\(realloc//g;' < 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 "3" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1372" $at_failed && at_fn_log_failure $at_traceon; } fi cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include /* printf */ #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); } %debug %define api.push-pull pull %define api.pure %define parse.error verbose %token 'c' %expect 21 %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | %empty { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: %empty { printf ("consistent default reduction\n"); } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "bbbbc"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1373: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1373" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1373" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1373: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1373" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1373" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1373: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1373" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1373" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1373: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1373" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1373" $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:1373: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1373" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1373" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1373" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1373" { set +x $as_echo "$at_srcdir/regression.at:1373: \$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:1373" ( $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:1373" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1373: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1373" ( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1373" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1373: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1373" ( $at_check_trace; 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:1373" $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:1373: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1373" ( $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:1373" $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. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1373: \"\$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" "regression.at:1373" ( $at_check_trace; "$PERL" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.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 "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1373" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1373: \"\$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" "regression.at:1373" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\bconsistent default reduction//g;' stdout.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 "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1373" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1373: \"\$PERL\" -0777 -ne 'print s/\\(realloc//g;' < stderr.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\(realloc//g;' < stderr.txt" "regression.at:1373" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\(realloc//g;' < 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 "3" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1373" $at_failed && at_fn_log_failure $at_traceon; } fi cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include /* printf */ #include static void yyerror (const char *msg); static int yylex (void); } %debug %define api.push-pull both %define parse.error verbose %token 'c' %expect 21 %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | %empty { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: %empty { printf ("consistent default reduction\n"); } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "bbbbc"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1374: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1374" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1374" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1374: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1374" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1374" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1374: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1374" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1374" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1374: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1374" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1374" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1374: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1374" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1374" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1374" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1374" { set +x $as_echo "$at_srcdir/regression.at:1374: \$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:1374" ( $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:1374" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1374: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1374" ( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1374" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1374" ( $at_check_trace; 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:1374" $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:1374: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1374" ( $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:1374" $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. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1374: \"\$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" "regression.at:1374" ( $at_check_trace; "$PERL" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.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 "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1374" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1374: \"\$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" "regression.at:1374" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\bconsistent default reduction//g;' stdout.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 "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1374" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1374: \"\$PERL\" -0777 -ne 'print s/\\(realloc//g;' < stderr.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\(realloc//g;' < stderr.txt" "regression.at:1374" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\(realloc//g;' < 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 "3" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1374" $at_failed && at_fn_log_failure $at_traceon; } fi cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include /* printf */ #include static void yyerror (const char *msg); static int yylex (YYSTYPE *lvalp); } %debug %define api.push-pull both %define api.pure %define parse.error verbose %token 'c' %expect 21 %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | %empty { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: %empty { printf ("consistent default reduction\n"); } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (YYSTYPE *lvalp) { static char const input[] = "bbbbc"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1375: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1375" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1375" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1375: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1375" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1375" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1375: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1375" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1375" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1375: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1375" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/regression.at:1375: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full \\ -Dparse.lac.es-capacity-initial=1 \\ -Dparse.lac.memory-trace=full -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1375" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full \ -Dparse.lac.es-capacity-initial=1 \ -Dparse.lac.memory-trace=full -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1375" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1375" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1375" { set +x $as_echo "$at_srcdir/regression.at:1375: \$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:1375" ( $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:1375" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1375: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1375" ( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1375" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1375" ( $at_check_trace; 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:1375" $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:1375: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1375" ( $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:1375" $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. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1375: \"\$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" "regression.at:1375" ( $at_check_trace; "$PERL" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.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 "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1375" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1375: \"\$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" "regression.at:1375" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\bconsistent default reduction//g;' stdout.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 "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1375" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of reallocs to be sure reallocated memory isn't somehow # lost between LAC invocations. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1375: \"\$PERL\" -0777 -ne 'print s/\\(realloc//g;' < stderr.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\(realloc//g;' < stderr.txt" "regression.at:1375" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\(realloc//g;' < 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 "3" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1375" $at_failed && at_fn_log_failure $at_traceon; } fi cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include /* printf */ static int yylex (yy::parser::semantic_type *lvalp); } %debug %skeleton "lalr1.cc" %define parse.error verbose %token 'c' %expect 21 %% // default reductions in inconsistent states // v v v v v v v v v v v v v v S: A B A A B A A A A B A A A A A A A B C C A A A A A A A A A A A A B ; // ^ ^ ^ // LAC reallocs A: 'a' | %empty { printf ("inconsistent default reduction\n"); } ; B: 'b' ; C: %empty { printf ("consistent default reduction\n"); } ; %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = "bbbbc"; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1377: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full -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:1377" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1377: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.cc input.y" "regression.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -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:1377" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1377: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1377" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1377" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1377: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1377" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1377" $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:1377: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -o input.cc input.y" at_fn_check_prepare_trace "regression.at:1377" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -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:1377" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1377" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1377" { set +x $as_echo "$at_srcdir/regression.at:1377: \$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:1377" ( $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:1377" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1377: \$PREPARSER ./input --debug > stdout.txt 2> stderr.txt" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug > stdout.txt 2> stderr.txt" "regression.at:1377" ( $at_check_trace; $PREPARSER ./input --debug > stdout.txt 2> stderr.txt ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/regression.at:1377" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1377: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1377" ( $at_check_trace; 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:1377" $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:1377: grep 'syntax error,' stderr.txt" at_fn_check_prepare_trace "regression.at:1377" ( $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:1377" $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. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1377: \"\$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.txt" "regression.at:1377" ( $at_check_trace; "$PERL" -0777 -ne 'print s/inconsistent default reduction//g;' stdout.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 "14" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1377" $at_failed && at_fn_log_failure $at_traceon; } fi # Check number of default reductions in consistent states to be sure # it is performed before the syntax error is detected. if test x"$PERL" != x; then { set +x $as_echo "$at_srcdir/regression.at:1377: \"\$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" at_fn_check_prepare_dynamic "\"$PERL\" -0777 -ne 'print s/\\bconsistent default reduction//g;' stdout.txt" "regression.at:1377" ( $at_check_trace; "$PERL" -0777 -ne 'print s/\bconsistent default reduction//g;' stdout.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 "2" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1377" $at_failed && at_fn_log_failure $at_traceon; } 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_531 #AT_START_532 at_fn_group_banner 532 'regression.at:1389' \ "LAC: Memory exhaustion" " " 22 at_xfail=no ( $as_echo "532. $at_setup_line: testing $at_desc ..." $at_traceon # Check for memory exhaustion during parsing. cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); #define YYMAXDEPTH 8 } %debug %define parse.error verbose %expect 8 %% S: A A A A A A A A A ; A: %empty | 'a' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1421: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1421" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1421: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y" "regression.at:1421" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1421" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1421: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1421" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1421" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1421: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1421" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1421" $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:1421: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y" at_fn_check_prepare_trace "regression.at:1421" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1421" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1421" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1421" { set +x $as_echo "$at_srcdir/regression.at:1421: \$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:1421" ( $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:1421" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1421" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1421" { set +x $as_echo "$at_srcdir/regression.at:1421: \$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:1421" ( $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:1421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1431: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:1431" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1431" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1431" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1431" $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 { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code { #include static void yyerror (const char *msg); static int yylex (void); #define YYMAXDEPTH 8 } %debug %define parse.error verbose %expect 8 %% S: A A A A A A A A A ; A: %empty | 'a' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "z"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1435: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1435" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1435" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1435: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y" "regression.at:1435" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1435" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1435: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1435" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1435" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1435: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1435" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1435" $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:1435: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y" at_fn_check_prepare_trace "regression.at:1435" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_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:1435" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1435" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1435" { set +x $as_echo "$at_srcdir/regression.at:1435: \$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:1435" ( $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:1435" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1435" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1435" { set +x $as_echo "$at_srcdir/regression.at:1435: \$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:1435" ( $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:1435" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1448: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "regression.at:1448" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 2 $at_status "$at_srcdir/regression.at:1448" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1448: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1448" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1448" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_532 #AT_START_533 at_fn_group_banner 533 'regression.at:1519' \ "Lex and parse params: yacc.c" " " 22 at_xfail=no ( $as_echo "533. $at_setup_line: testing $at_desc ..." $at_traceon ## FIXME: Improve parsing of parse-param. cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %skeleton "yacc.c" %union { int ival; } %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { int y } %{ #include /* printf. */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (int x, int y, const char *msg); static int yylex (void); %} %% exp: 'a' { printf ("x: %d, y: %d\n", x, y); }; %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (int x, int y, const char *msg) { YYUSE(x); YYUSE(y); LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:1519: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1519" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1519" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1519: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1519" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1519" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1519: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1519" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1519" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1519: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1519" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1519" $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:1519: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:1519" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1519" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1519" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1519" { set +x $as_echo "$at_srcdir/regression.at:1519: \$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:1519" ( $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:1519" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1519: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1519" ( $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:1519" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1519: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1519" ( $at_check_trace; 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:1519" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_533 #AT_START_534 at_fn_group_banner 534 'regression.at:1520' \ "Lex and parse params: glr.c" " " 22 at_xfail=no ( $as_echo "534. $at_setup_line: testing $at_desc ..." $at_traceon ## FIXME: Improve parsing of parse-param. cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %skeleton "glr.c" %union { int ival; } %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { int y } %{ #include /* printf. */ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (int x, int y, const char *msg); static int yylex (void); %} %% exp: 'a' { printf ("x: %d, y: %d\n", x, y); }; %% # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (int x, int y, const char *msg) { YYUSE(x); YYUSE(y); LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:1520: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1520" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1520" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1520: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1520" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1520" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1520: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1520" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1520" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1520: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1520" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1520" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1520: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:1520" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1520" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1520" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1520" { set +x $as_echo "$at_srcdir/regression.at:1520: \$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:1520" ( $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:1520" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1520: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1520" ( $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:1520" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1520: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1520" ( $at_check_trace; 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:1520" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_534 #AT_START_535 at_fn_group_banner 535 'regression.at:1521' \ "Lex and parse params: lalr1.cc" " " 22 at_xfail=no ( $as_echo "535. $at_setup_line: testing $at_desc ..." $at_traceon ## FIXME: Improve parsing of parse-param. cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %skeleton "lalr1.cc" %union { int ival; } %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { int y } %{ #include /* printf. */ static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %} %% exp: 'a' { printf ("x: %d, y: %d\n", x, y); }; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:1521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1521: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1521" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1521: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1521" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1521" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1521: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1521" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1521" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1521: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "regression.at:1521" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1521" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1521" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1521" { set +x $as_echo "$at_srcdir/regression.at:1521: \$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:1521" ( $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:1521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1521: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1521" ( $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:1521" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1521: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1521" ( $at_check_trace; 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:1521" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_535 #AT_START_536 at_fn_group_banner 536 'regression.at:1522' \ "Lex and parse params: glr.cc" " " 22 at_xfail=no ( $as_echo "536. $at_setup_line: testing $at_desc ..." $at_traceon ## FIXME: Improve parsing of parse-param. cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %skeleton "glr.cc" %union { int ival; } %parse-param { int x } // Spaces, tabs, and new lines. %parse-param { int y } %{ #include /* printf. */ static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); %} %% exp: 'a' { printf ("x: %d, y: %d\n", x, y); }; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = "a"; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:1522: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1522" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1522" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1522: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "regression.at:1522" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1522" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1522: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1522" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1522" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1522: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1522" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1522" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/regression.at:1522: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "regression.at:1522" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1522" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1522" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1522" { set +x $as_echo "$at_srcdir/regression.at:1522: \$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:1522" ( $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:1522" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1522: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "regression.at:1522" ( $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:1522" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1522: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "regression.at:1522" ( $at_check_trace; 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:1522" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_536 #AT_START_537 at_fn_group_banner 537 'regression.at:1533' \ "stdio.h is not needed" " " 22 at_xfail=no ( $as_echo "537. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %locations %code { static int yylex (void) { return 0; } static void yyerror (const char* msg) { (void) msg; } } %% exp: {} %% #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/regression.at:1550: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "regression.at:1550" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1550" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/regression.at:1550: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "regression.at:1550" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1550" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/regression.at:1550: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1550" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1550" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/regression.at:1550: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1550" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/regression.at:1550: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "regression.at:1550" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/regression.at:1550" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "regression.at:1550" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/regression.at:1550" { set +x $as_echo "$at_srcdir/regression.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" "regression.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/regression.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_537 #AT_START_538 at_fn_group_banner 538 'push.at:25' \ "Memory Leak for Early Deletion" " " 23 at_xfail=no ( $as_echo "538. $at_setup_line: testing $at_desc ..." $at_traceon # Requires Valgrind. cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #define YYINITDEPTH 1 #include static void yyerror (const char *msg); %} %define api.pure %define api.push-pull push %% start: 'a' 'b' 'c' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { yypstate *ps; /* Make sure we don't try to free ps->yyss in this case. */ ps = yypstate_new (); yypstate_delete (ps); /* yypstate_delete used to leak ps->yyss if the stack was reallocated but the parse did not return on success, syntax error, or memory exhaustion. */ ps = yypstate_new (); assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE); yypstate_delete (ps); ps = yypstate_new (); assert (yypush_parse (ps, 'a', YY_NULLPTR) == YYPUSH_MORE); assert (yypush_parse (ps, 'b', YY_NULLPTR) == YYPUSH_MORE); yypstate_delete (ps); return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/push.at:74: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "push.at:74" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:74" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:74" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/push.at:74: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:74" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:74" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/push.at:74: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:74" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:74" $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:74: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "push.at:74" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:74" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "push.at:75" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/push.at:75" { set +x $as_echo "$at_srcdir/push.at:75: \$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:75" ( $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:75" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:76: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.at:76" ( $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:76" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:76: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "push.at:76" ( $at_check_trace; 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: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_538 #AT_START_539 at_fn_group_banner 539 'push.at:84' \ "Multiple impure instances" " " 23 at_xfail=no ( $as_echo "539. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include static void yyerror (const char *msg); static int yylex (void); %} %define api.push-pull both %% start: ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } int main (void) { int i; for (i = 0; i < 2; ++i) { yypstate *ps = yypstate_new (); assert (ps); assert (yypstate_new () == YY_NULLPTR); assert (yyparse () == 2); yychar = 0; assert (yypush_parse (ps) == 0); assert (yypstate_new () == YY_NULLPTR); assert (yyparse () == 2); yypstate_delete (ps); } return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/push.at:134: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "push.at:134" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:134" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/push.at:134: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "push.at:134" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:134" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "push.at:134" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/push.at:134" { 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; } cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include static void yyerror (const char *msg); %} %define api.push-pull push %% start: ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { int i; for (i = 0; i < 2; ++i) { yypstate *ps = yypstate_new (); assert (ps); assert (yypstate_new () == YY_NULLPTR); ; yychar = 0; assert (yypush_parse (ps) == 0); assert (yypstate_new () == YY_NULLPTR); ; yypstate_delete (ps); } return 0; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/push.at:135: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "push.at:135" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:135: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "push.at:135" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/push.at:135" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/push.at:135: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:135" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:135" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/push.at:135: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:135" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/push.at:135: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "push.at:135" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/push.at:135" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "push.at:135" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/push.at:135" { set +x $as_echo "$at_srcdir/push.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" "push.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/push.at:135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:135: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "push.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 0 $at_status "$at_srcdir/push.at:135" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/push.at:135: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "push.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 at_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: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_539 #AT_START_540 at_fn_group_banner 540 'push.at:145' \ "Unsupported Skeletons" " " 23 at_xfail=no ( $as_echo "540. $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:158: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "push.at:158" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y:2.1-26: 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: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_540 #AT_START_541 at_fn_group_banner 541 'c++.at:26' \ "C++ Locations Unit Tests" " " 24 at_xfail=no ( $as_echo "541. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code {#include } %locations %debug %skeleton "lalr1.cc" %code { static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); } %% exp: %empty; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { static char const input[] = ""; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; (*llocp).begin.line = (*llocp).end.line = 1; (*llocp).begin.column = (*llocp).end.column = toknum; return res; } template bool check (const T& in, const std::string& s) { std::stringstream os; os << in; if (os.str () != s) { std::cerr << "fail: " << os.str () << ", expected: " << s << '\n'; return false; } return true; } int main (void) { int fail = 0; yy::parser::location_type loc; fail += check (loc, "1.1"); fail += check (loc + 10, "1.1-10"); loc += 10; fail += check (loc, "1.1-10"); loc += -5; fail += check (loc, "1.1-5"); fail += check (loc - 5, "1.1"); loc -= 5; fail += check (loc, "1.1"); // Check that we don't go below. // http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html loc -= 10; fail += check (loc, "1.1"); loc.columns (10); loc.lines (10); fail += check (loc, "1.1-11.0"); loc.lines (-2); fail += check (loc, "1.1-9.0"); loc.lines (-10); fail += check (loc, "1.1"); yy::parser::location_type loc2 (YY_NULLPTR, 5, 10); fail += check (loc2, "5.10"); fail += check (loc + loc2, "1.1-5.9"); loc += loc2; fail += check (loc, "1.1-5.9"); return !fail; } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:88: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:88" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:88" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:88: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:88" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:88" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:88: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:88" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:88" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:88: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:88" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:88" $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:88: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "c++.at:88" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:88" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:88" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:88" { set +x $as_echo "$at_srcdir/c++.at:88: \$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:88" ( $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:88" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:88: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:88" ( $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:88" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:88: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:88" ( $at_check_trace; 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:88" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_541 #AT_START_542 at_fn_group_banner 542 'c++.at:100' \ "C++ Variant-based Symbols Unit Tests" " " 24 at_xfail=no ( $as_echo "542. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %define api.value.type variant %define parse.assert %debug %code top { // Get access to stack_symbol_type for the tests. # define private public } %code provides { static int yylex (yy::parser::semantic_type *lvalp); } %token INT "int" %type > exp %printer { yyo << $$; } %printer { for (std::vector::const_iterator i = $$.begin (); i != $$.end (); ++i) { if (i != $$.begin ()) yyo << ", "; yyo << *i; } } > %code requires { #include } %code { int yylex (yy::parser::semantic_type* lvalp); } %% exp: "int" { $$.push_back ($1); } %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static int yylex (yy::parser::semantic_type *lvalp) { static char const input[] = ""; static int toknum = 0; int res; (void) lvalp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } template void assert_eq (const Exp& exp, const Eff& eff) { if (getenv ("DEBUG")) std::cerr << "Assert: " << exp << " == " << eff << '\n'; if (exp != eff) std::cerr << "Assertion failed: " << exp << " != " << eff << '\n'; } int main() { using yy::parser; // symbol_type: construction, accessor. { parser::symbol_type s = parser::make_INT (12); assert_eq (s.value.as (), 12); } // symbol_type: move constructor. #if 201103L <= YY_CPLUSPLUS { auto s = parser::make_INT (42); auto s2 = std::move (s); assert_eq (s2.value.as (), 42); // Used to crash here, because s was improperly cleared, and // its destructor tried to delete its (moved) value. } #endif // symbol_type: copy constructor. { parser::symbol_type s = parser::make_INT (51); parser::symbol_type s2 = s; assert_eq (s.value.as (), 51); assert_eq (s2.value.as (), 51); } // stack_symbol_type: construction, accessor. { #if 201103L <= YY_CPLUSPLUS auto ss = parser::stack_symbol_type(1, parser::make_INT(123)); #else parser::symbol_type s = parser::make_INT (123); parser::stack_symbol_type ss(1, s); #endif assert_eq (ss.value.as (), 123); } // Pushing on the stack. // Sufficiently many so that it will be resized. // Probably 3 times (starting at 200). { parser::stack_type st; const int mucho = 1700; const int int_reduction_state = 1; // Read list.output to find it. for (int i = 0; i < mucho; ++i) { #if 201103L <= YY_CPLUSPLUS st.push(parser::stack_symbol_type{int_reduction_state, parser::make_INT (i)}); #else parser::symbol_type s = parser::make_INT (i); parser::stack_symbol_type ss (int_reduction_state, s); st.push (ss); #endif } for (int i = mucho - 1; 0 <= i; --i) { assert_eq (st[0].value.as(), i); st.pop (); } } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:220: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:220" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.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:220" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:220: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.yy" "c++.at:220" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.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:220" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:220: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:220" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:220" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:220: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:220" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/c++.at:220: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.yy" at_fn_check_prepare_trace "c++.at:220" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.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:220" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:224" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:224" { set +x $as_echo "$at_srcdir/c++.at:224: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:224" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:224: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:224" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:224: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:224" ( $at_check_trace; 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:224" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_542 #AT_START_543 at_fn_group_banner 543 'c++.at:233' \ "Multiple occurrences of \$n and api.value.automove" "" 24 at_xfail=no ( $as_echo "543. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %define api.value.automove %token NUMBER "number" %type exp %% exp: "number" { $$ = $1; $$; } | "twice" exp { $$ = $2 + $2; } | "thrice" exp[val] { $$ = $2 + $val + $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/c++.at:259: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret 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:259" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:259: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.yy" "c++.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret 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:259" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:259: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:259" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:259" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:259: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:259" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:259" $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:259: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.yy" at_fn_check_prepare_trace "c++.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.yy:16.33-34: warning: multiple occurrences of \$2 with api.value.automove [-Wother] 16 | | \"twice\" exp { \$\$ = \$2 + \$2; } | ^~ input.yy:17.33-36: warning: multiple occurrences of \$2 with api.value.automove [-Wother] 17 | | \"thrice\" exp[val] { \$\$ = \$2 + \$val + \$2; } | ^~~~ input.yy:17.40-41: warning: multiple occurrences of \$2 with api.value.automove [-Wother] 17 | | \"thrice\" exp[val] { \$\$ = \$2 + \$val + \$2; } | ^~ " | \ $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:259" $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/c++.at:259: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy -Werror" "c++.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/c++.at:259" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.yy:16.33-34: warning: multiple occurrences of $2 with api.value.automove [-Wother] 16 | | "twice" exp { $$ = $2 + $2; } | ^~ input.yy:17.33-36: warning: multiple occurrences of $2 with api.value.automove [-Wother] 17 | | "thrice" exp[val] { $$ = $2 + $val + $2; } | ^~~~ input.yy:17.40-41: warning: multiple occurrences of $2 with api.value.automove [-Wother] 17 | | "thrice" exp[val] { $$ = $2 + $val + $2; } | ^~ _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/c++.at:259: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "c++.at:259" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:259" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/c++.at:259: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy --warnings=error" "c++.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/c++.at:259" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/c++.at:259: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy -Wnone,none -Werror --trace=none" "c++.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:259" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:259: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy --warnings=none -Werror --trace=none" "c++.at:259" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.yy --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:259" $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_543 #AT_START_544 at_fn_group_banner 544 'c++.at:552' \ "Variants lalr1.cc" " " 24 at_xfail=no ( $as_echo "544. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static int yylex (yy::parser::semantic_type *lvalp); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #ifdef TWO_STAGE_BUILD # define BUILD(Type, Value) build () = Value #else # define BUILD(Type, Value) build (Value) #endif #define STAGE_MAX 5 namespace yy { static int yylex (yy::parser::semantic_type *lvalp) { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: return parser::token::END_OF_FILE; case ',': return parser::token::COMMA; default: stage = stage - '0'; if (stage % 2) { lvalp->BUILD (int, stage); return parser::token::NUMBER; } else { lvalp->BUILD (string, to_string (stage)); return parser::token::TEXT; } } } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:552: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:552: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:552: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:552" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:552" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:552: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:552" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:552" $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:552: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:552" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:552" { set +x $as_echo "$at_srcdir/c++.at:552: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:552" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:552" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:552" { set +x $as_echo "$at_srcdir/c++.at:552: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:552" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:552" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:552: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:552" ( $at_check_trace; $here/modern ) >>"$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/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if false; then { set +x $as_echo "$at_srcdir/c++.at:552: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:552" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:552: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:552" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:552: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:552" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:552: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:552" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:552" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_544 #AT_START_545 at_fn_group_banner 545 'c++.at:553' \ "Variants lalr1.cc parse.assert" " " 24 at_xfail=no ( $as_echo "545. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %define parse.assert %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static int yylex (yy::parser::semantic_type *lvalp); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #ifdef TWO_STAGE_BUILD # define BUILD(Type, Value) build () = Value #else # define BUILD(Type, Value) build (Value) #endif #define STAGE_MAX 5 namespace yy { static int yylex (yy::parser::semantic_type *lvalp) { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: return parser::token::END_OF_FILE; case ',': return parser::token::COMMA; default: stage = stage - '0'; if (stage % 2) { lvalp->BUILD (int, stage); return parser::token::NUMBER; } else { lvalp->BUILD (string, to_string (stage)); return parser::token::TEXT; } } } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:553: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:553: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:553: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:553" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:553" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:553: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:553" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:553" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:553: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:553" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:553" { set +x $as_echo "$at_srcdir/c++.at:553: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:553" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:553" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:553" { set +x $as_echo "$at_srcdir/c++.at:553: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:553" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:553" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:553: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:553" ( $at_check_trace; $here/modern ) >>"$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/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if false; then { set +x $as_echo "$at_srcdir/c++.at:553: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:553" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:553: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:553" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:553: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:553" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:553: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:553" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:553" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_545 #AT_START_546 at_fn_group_banner 546 'c++.at:554' \ "Variants lalr1.cc parse.assert api.value.automove" "" 24 at_xfail=no ( $as_echo "546. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %define parse.assert %define api.value.automove %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static int yylex (yy::parser::semantic_type *lvalp); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #ifdef TWO_STAGE_BUILD # define BUILD(Type, Value) build () = Value #else # define BUILD(Type, Value) build (Value) #endif #define STAGE_MAX 5 namespace yy { static int yylex (yy::parser::semantic_type *lvalp) { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: return parser::token::END_OF_FILE; case ',': return parser::token::COMMA; default: stage = stage - '0'; if (stage % 2) { lvalp->BUILD (int, stage); return parser::token::NUMBER; } else { lvalp->BUILD (string, to_string (stage)); return parser::token::TEXT; } } } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:554: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:554" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:554: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:554" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:554: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:554" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:554" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:554: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:554" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:554" $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:554: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:554" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:554" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:554" { set +x $as_echo "$at_srcdir/c++.at:554: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:554" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:554" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:554" { set +x $as_echo "$at_srcdir/c++.at:554: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:554" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:554" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:554: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:554" ( $at_check_trace; $here/modern ) >>"$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/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if $modern; then { set +x $as_echo "$at_srcdir/c++.at:554: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:554" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:554: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:554" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:554: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:554" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:554: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:554" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:554" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_546 #AT_START_547 at_fn_group_banner 547 'c++.at:555' \ "Variants lalr1.cc parse.assert %locations" " " 24 at_xfail=no ( $as_echo "547. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %define parse.assert %locations %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #ifdef TWO_STAGE_BUILD # define BUILD(Type, Value) build () = Value #else # define BUILD(Type, Value) build (Value) #endif #define STAGE_MAX 5 namespace yy { static int yylex (yy::parser::semantic_type *lvalp, yy::parser::location_type *llocp) { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: *llocp = location (); return parser::token::END_OF_FILE; case ',': *llocp = location (); return parser::token::COMMA; default: stage = stage - '0'; if (stage % 2) { lvalp->BUILD (int, stage); *llocp = location (); return parser::token::NUMBER; } else { lvalp->BUILD (string, to_string (stage)); *llocp = location (); return parser::token::TEXT; } } } } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:555: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:555" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:555: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:555" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:555: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:555" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:555" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:555: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:555" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:555" $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:555: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:555" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:555" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:555" { set +x $as_echo "$at_srcdir/c++.at:555: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:555" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:555" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:555" { set +x $as_echo "$at_srcdir/c++.at:555: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:555" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:555" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:555: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:555" ( $at_check_trace; $here/modern ) >>"$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/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if false; then { set +x $as_echo "$at_srcdir/c++.at:555: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:555" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:555: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.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 "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:555: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:555" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:555: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.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 "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:555" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_547 #AT_START_548 at_fn_group_banner 548 'c++.at:556' \ "Variants lalr1.cc parse.assert %code {\\n#define TWO_STAGE_BUILD\\n}" "" 24 at_xfail=no ( $as_echo "548. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %define parse.assert %code { #define TWO_STAGE_BUILD } %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static int yylex (yy::parser::semantic_type *lvalp); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #ifdef TWO_STAGE_BUILD # define BUILD(Type, Value) build () = Value #else # define BUILD(Type, Value) build (Value) #endif #define STAGE_MAX 5 namespace yy { static int yylex (yy::parser::semantic_type *lvalp) { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: return parser::token::END_OF_FILE; case ',': return parser::token::COMMA; default: stage = stage - '0'; if (stage % 2) { lvalp->BUILD (int, stage); return parser::token::NUMBER; } else { lvalp->BUILD (string, to_string (stage)); return parser::token::TEXT; } } } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:556: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:556" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:556: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:556" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:556: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:556" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:556" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:556: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:556" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/c++.at:556: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:556" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:556" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:556" { set +x $as_echo "$at_srcdir/c++.at:556: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:556" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:556" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:556" { set +x $as_echo "$at_srcdir/c++.at:556: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:556" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:556" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:556: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:556" ( $at_check_trace; $here/modern ) >>"$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/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if false; then { set +x $as_echo "$at_srcdir/c++.at:556: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:556" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:556: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:556" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:556: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:556" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:556: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:556" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:556" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_548 #AT_START_549 at_fn_group_banner 549 'c++.at:557' \ "Variants lalr1.cc parse.assert api.token.constructor" "" 24 at_xfail=no ( $as_echo "549. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static yy::parser::symbol_type yylex (); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #define STAGE_MAX 5 namespace yy { static yy::parser::symbol_type yylex () { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: return parser::make_END_OF_FILE (); case ',': return parser::make_COMMA (); default: stage = stage - '0'; if (stage % 2) { return parser::make_NUMBER (stage); } else { return parser::make_TEXT (to_string (stage)); } } } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:557: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:557" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:557: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:557" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:557: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:557" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:557" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:557: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:557" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:557" $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:557: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:557" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:557" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:557" { set +x $as_echo "$at_srcdir/c++.at:557: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:557" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:557" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:557" { set +x $as_echo "$at_srcdir/c++.at:557: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:557" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:557" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:557: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:557" ( $at_check_trace; $here/modern ) >>"$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/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if false; then { set +x $as_echo "$at_srcdir/c++.at:557: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:557" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:557: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:557" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:557: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:557" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:557: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:557" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:557" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_549 #AT_START_550 at_fn_group_banner 550 'c++.at:558' \ "Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_}" "" 24 at_xfail=no ( $as_echo "550. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_} %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static yy::parser::symbol_type yylex (); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #define STAGE_MAX 5 namespace yy { static yy::parser::symbol_type yylex () { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: return parser::make_END_OF_FILE (); case ',': return parser::make_COMMA (); default: stage = stage - '0'; if (stage % 2) { return parser::make_NUMBER (stage); } else { return parser::make_TEXT (to_string (stage)); } } } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:558: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:558" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:558: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:558" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:558: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:558" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:558" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:558: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:558" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:558" $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:558: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:558" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:558" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:558" { set +x $as_echo "$at_srcdir/c++.at:558: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:558" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:558" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:558" { set +x $as_echo "$at_srcdir/c++.at:558: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:558" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:558" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:558: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:558" ( $at_check_trace; $here/modern ) >>"$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/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if false; then { set +x $as_echo "$at_srcdir/c++.at:558: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:558" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:558: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:558" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:558: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:558" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:558: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:558" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:558" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_550 #AT_START_551 at_fn_group_banner 551 'c++.at:559' \ "Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations" "" 24 at_xfail=no ( $as_echo "551. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_} %locations %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static yy::parser::symbol_type yylex (); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #define STAGE_MAX 5 namespace yy { static yy::parser::symbol_type yylex () { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: return parser::make_END_OF_FILE (location ()); case ',': return parser::make_COMMA (location ()); default: stage = stage - '0'; if (stage % 2) { return parser::make_NUMBER (stage, location ()); } else { return parser::make_TEXT (to_string (stage), location ()); } } } } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:559: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:559" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:559: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:559" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:559: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:559" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:559" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:559: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:559" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/c++.at:559: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:559" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:559" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:559" { set +x $as_echo "$at_srcdir/c++.at:559: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:559" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:559" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:559" { set +x $as_echo "$at_srcdir/c++.at:559: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:559" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:559" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:559: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:559" ( $at_check_trace; $here/modern ) >>"$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/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if false; then { set +x $as_echo "$at_srcdir/c++.at:559: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:559" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:559: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:559" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:559: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:559" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:559: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:559" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:559" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_551 #AT_START_552 at_fn_group_banner 552 'c++.at:560' \ "Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations api.value.automove" "" 24 at_xfail=no ( $as_echo "552. $at_setup_line: testing $at_desc ..." $at_traceon # Store strings and integers in a vector of strings. cat >list.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %debug %define api.value.type variant %skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_} %locations %define api.value.automove %code top // code for the .cc file. { #include // abort, getenv #include #include #include #include class string { public: string () {} string (const std::string& s) : val_(s) {} string (const string& s) : val_(s.val_) {} string& operator= (const string& s) { val_ = s.val_; return *this; } #if defined __cplusplus && 201103L <= __cplusplus string (string&& s) noexcept : val_(std::move(s.val_)) { s.val_.clear(); } string& operator= (string&& s) { val_ = std::move(s.val_); s.val_.clear (); return *this; } #endif friend std::ostream& operator<< (std::ostream& o, const string& s) { return o << s.val_; } private: std::string val_; }; typedef std::vector strings_type; namespace yy { // Must be available early, as is used in %destructor. std::ostream& operator<<(std::ostream& o, const strings_type& s) { o << '('; for (strings_type::const_iterator i = s.begin (); i != s.end (); ++i) { if (i != s.begin ()) o << ", "; o << *i; } return o << ')'; } } } %code // code for the .cc file. { namespace yy { static yy::parser::symbol_type yylex (); // Conversion to string. template inline string to_string (const T& t) { std::ostringstream o; o << t; return string (o.str ()); } } } %token <::string> TEXT; %token NUMBER; %token END_OF_FILE 0; %token COMMA "," // Starting with :: to ensure we don't output "<::" which starts by the // digraph for the left square bracket. %type <::string> item; // Using the template type to exercize its parsing. %type <::std::vector> list; %printer { yyo << $$; } <::string> <::std::vector>; %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>; %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::string>; %% result: list { std::cout << $1 << '\n'; } ; list: item { $$.push_back ($1); } | list "," item { $$ = $1; $$.push_back ($3); } | list error { $$ = $1; } ; item: TEXT { $$ = $1; } | NUMBER { int v = $1; if (v == 3) YYERROR; else $$ = to_string (v); } ; %% #define STAGE_MAX 5 namespace yy { static yy::parser::symbol_type yylex () { // The 5 is a syntax error whose recovery requires that we discard // the lookahead. This tests a regression, see // . static char const *input = "0,1,2,3,45,6"; switch (int stage = *input++) { case 0: return parser::make_END_OF_FILE (location ()); case ',': return parser::make_COMMA (location ()); default: stage = stage - '0'; if (stage % 2) { return parser::make_NUMBER (stage, location ()); } else { return parser::make_TEXT (to_string (stage), location ()); } } } } /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF cat >modern.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include int main() { #if defined __cplusplus && 201103L <= __cplusplus std::cout << "Modern C++: " << __cplusplus << '\n'; return 0; #else std::cout << "Legac++\n"; return 1; #endif } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:560: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o list.cc list.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:560" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:560: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y" "c++.at:560" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:560: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:560" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:560" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:560: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:560" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:560" $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:560: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y" at_fn_check_prepare_trace "c++.at:560" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o list.cc list.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:560" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:560" { set +x $as_echo "$at_srcdir/c++.at:560: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o list list.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS" "c++.at:560" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o list list.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } # Are we compiling with modern C++ enabled? $as_echo "c++.at:560" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:560" { set +x $as_echo "$at_srcdir/c++.at:560: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o modern modern.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.cc $LIBS" "c++.at:560" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o modern modern.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:560" $at_failed && at_fn_log_failure $at_traceon; } here=. # Pacify cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:560: \$here/modern" at_fn_check_prepare_dynamic "$here/modern" "c++.at:560" ( $at_check_trace; $here/modern ) >>"$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/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status = 0; then modern=true else modern=false fi if $modern; then { set +x $as_echo "$at_srcdir/c++.at:560: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:560" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:560: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:560" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"\" Destroy: \"\" Destroy: 1 Destroy: \"\" Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: \"\" Destroy: 3 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: () Destroy: 5 Destroy: () Destroy: \"\" Destroy: \"\" Destroy: () Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } else { set +x $as_echo "$at_srcdir/c++.at:560: \$PREPARSER ./list" at_fn_check_prepare_dynamic " $PREPARSER ./list" "c++.at:560" ( $at_check_trace; $PREPARSER ./list ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "(0, 1, 2, 4, 6) " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:560: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:560" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Destroy: \"0\" Destroy: \"0\" Destroy: 1 Destroy: \"1\" Destroy: (0) Destroy: \"2\" Destroy: \"2\" Destroy: (0, 1) Destroy: \"\" Destroy: 3 Destroy: (0, 1, 2) Destroy: \"4\" Destroy: \"4\" Destroy: (0, 1, 2) Destroy: (0, 1, 2, 4) Destroy: 5 Destroy: (0, 1, 2, 4) Destroy: \"6\" Destroy: \"6\" Destroy: (0, 1, 2, 4) Destroy: (0, 1, 2, 4, 6) " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:560" $at_failed && at_fn_log_failure $at_traceon; } fi done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_552 #AT_START_553 at_fn_group_banner 553 'c++.at:570' \ "Variants and Typed Midrule Actions" " " 24 at_xfail=no ( $as_echo "553. $at_setup_line: testing $at_desc ..." $at_traceon # See http://lists.gnu.org/archive/html/bug-bison/2017-06/msg00000.html. # # Check that typed midrule actions behave properly (pre-construction # of $$ before the user action, support of %printer and %destructor, # etc.). cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %defines %debug %define parse.assert %define api.value.type variant %define api.token.constructor %define parse.error verbose %code { #include namespace yy { static yy::parser::symbol_type yylex(); } } %token NUMBER; %type expr; %token EOI 0; %printer { yyo << $$; } ; %destructor { std::cerr << "destroy: " << $$ << '\n'; } %% expr: NUMBER { $$ = $1 * 10; } | expr { $$ = 20; } NUMBER { std::cerr << "expr: " << $1 << ' ' << $2 << ' ' << $3 << '\n'; $$ = 40; } ; %% namespace yy { parser::symbol_type yylex() { static int loc = 0; switch (loc++) { case 0: return parser::make_NUMBER (1); case 1: return parser::make_NUMBER (30); default: return parser::make_EOI (); } } void parser::error(const std::string& message) { std::cerr << message << '\n'; } } int main() { yy::parser p; p.set_debug_level (1); return p.parse(); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:686: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:686" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:686" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:686: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:686" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:686" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:686: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:686" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:686" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:686: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:686" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:686" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:686: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "c++.at:686" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:686" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:686" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:686" { set +x $as_echo "$at_srcdir/c++.at:686: \$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:686" ( $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:686" $at_failed && at_fn_log_failure $at_traceon; } # This used to print "Discarding 'a'." again at the end. { set +x $as_echo "$at_srcdir/c++.at:686: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:686" ( $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:686" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:686: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:686" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reading a token: Next token is token NUMBER (1) Shifting token NUMBER (1) Entering state 1 Reducing stack by rule 1 (line 34): \$1 = token NUMBER (1) -> \$\$ = nterm expr (10) destroy: 1 Stack now 0 Entering state 2 Reading a token: Next token is token NUMBER (30) Reducing stack by rule 2 (line 35): -> \$\$ = nterm @1 (20) Stack now 2 0 Entering state 4 Next token is token NUMBER (30) Shifting token NUMBER (30) Entering state 5 Reducing stack by rule 3 (line 35): \$1 = nterm expr (10) \$2 = nterm @1 (20) \$3 = token NUMBER (30) expr: 10 20 30 -> \$\$ = nterm expr (40) destroy: 30 destroy: 20 destroy: 10 Stack now 0 Entering state 2 Reading a token: Next token is token EOI () Shifting token EOI () Entering state 3 Cleanup: popping token EOI () Cleanup: popping nterm expr (40) destroy: 40 " | \ $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:686" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_553 #AT_START_554 at_fn_group_banner 554 'c++.at:772' \ "Doxygen Public Documentation" " " 24 at_xfail=no ( $as_echo "554. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %require "3.2" %skeleton "lalr1.cc" %locations %defines %debug %% exp: %empty; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:772: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:772" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:772: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:772" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:772" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:772: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:772" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/c++.at:772: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:772" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:772" $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:772: doxygen --version || exit 77" at_fn_check_prepare_trace "c++.at:772" ( $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:772" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:772: doxygen" at_fn_check_prepare_trace "c++.at:772" ( $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:772" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_554 #AT_START_555 at_fn_group_banner 555 'c++.at:773' \ "Doxygen Private Documentation" " " 24 at_xfail=no ( $as_echo "555. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %require "3.2" %skeleton "lalr1.cc" %locations %defines %debug %% exp: %empty; %% /* A C++ error reporting function. */ void yy::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:773: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:773" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:773: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:773" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:773" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:773: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:773" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:773" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:773: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:773" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:773" $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:773: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:773" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:773" $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:773: doxygen --version || exit 77" at_fn_check_prepare_trace "c++.at:773" ( $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:773" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:773: doxygen" at_fn_check_prepare_trace "c++.at:773" ( $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:773" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_555 #AT_START_556 at_fn_group_banner 556 'c++.at:828' \ "Relative namespace references" " " 24 at_xfail=no ( $as_echo "556. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {foo} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const foo::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void foo::parser::error (const foo::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { foo::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:829: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:829" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:829" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:829: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:829" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:829" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:829: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:829" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:829" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:829: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:829" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:829" $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:829: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:829" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:829" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:829" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:829" { set +x $as_echo "$at_srcdir/c++.at:829: \$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:829" ( $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:829" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:829: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:829" ( $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:829" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:829: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:829" ( $at_check_trace; 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:829" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {foo::bar} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const foo::bar::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void foo::bar::parser::error (const foo::bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { foo::bar::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:830: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:830" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:830" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:830: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:830" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:830" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:830: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:830" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:830" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:830: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:830" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:830" $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:830: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:830" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:830" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:830" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:830" { set +x $as_echo "$at_srcdir/c++.at:830: \$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:830" ( $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:830" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:830: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:830" ( $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:830" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:830: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:830" ( $at_check_trace; 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:830" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {foo::bar::baz} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const foo::bar::baz::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void foo::bar::baz::parser::error (const foo::bar::baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { foo::bar::baz::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:831: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:831" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:831" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:831: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:831" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:831" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:831: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:831" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:831" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:831: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:831" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:831" $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:831: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:831" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:831" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:831" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:831" { set +x $as_echo "$at_srcdir/c++.at:831: \$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:831" ( $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:831" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:831: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:831" ( $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:831" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:831: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:831" ( $at_check_trace; 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:831" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_556 #AT_START_557 at_fn_group_banner 557 'c++.at:834' \ "Absolute namespace references" " " 24 at_xfail=no ( $as_echo "557. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {::foo} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const ::foo::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::parser::error (const ::foo::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { ::foo::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:835: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:835" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:835" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:835: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:835" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:835" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:835: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:835" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:835" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:835: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:835" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:835" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:835: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:835" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:835" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:835" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:835" { set +x $as_echo "$at_srcdir/c++.at:835: \$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:835" ( $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:835" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:835: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:835" ( $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:835" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:835: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:835" ( $at_check_trace; 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:835" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {::foo::bar} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const ::foo::bar::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { ::foo::bar::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:836: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:836" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:836" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:836: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:836" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:836" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:836: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:836" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:836" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:836: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:836" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:836" $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:836: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:836" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:836" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:836" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:836" { set +x $as_echo "$at_srcdir/c++.at:836: \$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:836" ( $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:836" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:836: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:836" ( $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:836" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:836: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:836" ( $at_check_trace; 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:836" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {::foo::bar::baz} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const ::foo::bar::baz::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { ::foo::bar::baz::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:837: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:837" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:837: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:837" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:837" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:837: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:837" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:837" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:837: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:837" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:837" $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:837: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:837" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:837" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:837" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:837" { set +x $as_echo "$at_srcdir/c++.at:837: \$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:837" ( $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:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:837: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:837" ( $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:837" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:837: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:837" ( $at_check_trace; 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:837" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace { ::foo} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const ::foo::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::parser::error (const ::foo::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { ::foo::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:838: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:838" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:838: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:838" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:838" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:838: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:838" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:838" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:838: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:838" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:838" $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:838: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:838" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:838" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:838" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:838" { set +x $as_echo "$at_srcdir/c++.at:838: \$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:838" ( $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:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:838: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:838" ( $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:838" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:838: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:838" ( $at_check_trace; 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:838" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace { ::foo::bar} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const ::foo::bar::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::bar::parser::error (const ::foo::bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { ::foo::bar::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:839: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:839" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:839: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:839" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:839" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:839: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:839" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:839" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:839: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:839" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:839" $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:839: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:839" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:839" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:839" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:839" { set +x $as_echo "$at_srcdir/c++.at:839: \$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:839" ( $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:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:839: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:839" ( $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:839" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:839: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:839" ( $at_check_trace; 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:839" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace { ::foo::bar::baz} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const ::foo::bar::baz::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void ::foo::bar::baz::parser::error (const ::foo::bar::baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { ::foo::bar::baz::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:840: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:840" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:840: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:840" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:840" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:840: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:840" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:840" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:840: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:840" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:840" $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:840: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:840" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:840" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:840" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:840" { set +x $as_echo "$at_srcdir/c++.at:840: \$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:840" ( $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:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:840: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:840" ( $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:840" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:840: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:840" ( $at_check_trace; 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:840" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_557 #AT_START_558 at_fn_group_banner 558 'c++.at:843' \ "Syntactically invalid namespace references" " " 24 at_xfail=no ( $as_echo "558. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {:foo:bar} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const :foo:bar::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void :foo:bar::parser::error (const :foo:bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { :foo:bar::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:844: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:844" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:844" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:844: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:844" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:844" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:844: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:844" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:844" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:844: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:844" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:844" $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:844: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:844" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:844" $at_failed && at_fn_log_failure $at_traceon; } cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {foo: :bar} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const foo: :bar::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void foo: :bar::parser::error (const foo: :bar::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { foo: :bar::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:845: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:845" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:845" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:845: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:845" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:845" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:845: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:845" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:845" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:845: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:845" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:845" $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:845: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:845" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:845" $at_failed && at_fn_log_failure $at_traceon; } # This one is interesting because '[3]' is encoded as '[3]', which # contains single occurrences of ':'. cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {foo[3]::bar::baz} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const foo[3]::bar::baz::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void foo[3]::bar::baz::parser::error (const foo[3]::bar::baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { foo[3]::bar::baz::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:848: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:848" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:848" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:848: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:848" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:848" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:848: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:848" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:848" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:848: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:848" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:848" $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:848: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:848" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:848" $at_failed && at_fn_log_failure $at_traceon; } cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {foo::bar,baz} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const foo::bar,baz::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void foo::bar,baz::parser::error (const foo::bar,baz::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { foo::bar,baz::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:849: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:849" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:849" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:849: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:849" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:849" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:849: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:849" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:849" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:849: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:849" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:849" $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:849: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:849" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:849" $at_failed && at_fn_log_failure $at_traceon; } cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %language "C++" %define api.namespace {foo::bar::(baz /* Pacify Emacs ) */} %union { int i; } %define global_tokens_and_yystype %locations %code { // YYSTYPE contains a namespace reference. int yylex (YYSTYPE *lval, const foo::bar::(baz /* Pacify Emacs ) */::parser::location_type*) { lval->i = 3; return 0; } } %% start: ; %% void foo::bar::(baz /* Pacify Emacs ) */::parser::error (const foo::bar::(baz /* Pacify Emacs ) */::parser::location_type &loc, const std::string &msg) { std::cerr << "At " << loc << ": " << msg << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { foo::bar::(baz /* Pacify Emacs ) */::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:850: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:850" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:850" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:850: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:850" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:850" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:850: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:850" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:850" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:850: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:850" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:850" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/c++.at:850: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:850" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:850" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_558 #AT_START_559 at_fn_group_banner 559 'c++.at:864' \ "Syntax error discarding no lookahead" " " 24 at_xfail=no ( $as_echo "559. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %code { #include int yylex (yy::parser::semantic_type *); #define USE(Args) } %define parse.error verbose %nonassoc 'a' ; %destructor { std::cerr << "Discarding 'a'.\n"; } 'a' %% start: error-reduce consistent-error 'a' { USE ($3); }; error-reduce: 'a' 'a' consistent-error 'a' { USE (($1, $2, $4)); } | 'a' error { std::cerr << "Reducing 'a'.\n"; USE ($1); } ; consistent-error: 'a' | %empty %prec 'a' ; // Provide another context in which all rules are useful so that this // test case looks a little more realistic. start: 'b' consistent-error ; %% int yylex (yy::parser::semantic_type *) { static char const *input = "aa"; return *input++; } void yy::parser::error (const std::string &m) { std::cerr << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations 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:929: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:929" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:929" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:929: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "c++.at:929" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:929" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:929: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:929" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:929" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:929: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:929" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:929" $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:929: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y" at_fn_check_prepare_trace "c++.at:929" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:929" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:929" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:929" { set +x $as_echo "$at_srcdir/c++.at:929: \$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:929" ( $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:929" $at_failed && at_fn_log_failure $at_traceon; } # This used to print "Discarding 'a'." again at the end. { set +x $as_echo "$at_srcdir/c++.at:929: \$PREPARSER ./input" at_fn_check_prepare_dynamic " $PREPARSER ./input" "c++.at:929" ( $at_check_trace; $PREPARSER ./input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/c++.at:929" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:929: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:929" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "syntax error Discarding 'a'. Reducing 'a'. " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:929" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_559 #AT_START_560 at_fn_group_banner 560 'c++.at:1043' \ "Syntax error as exception: lalr1.cc" " " 24 at_xfail=no ( $as_echo "560. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %defines %code { #include int yylex (yy::parser::semantic_type *); } %define parse.error verbose %define parse.trace %% start: with-recovery | '!' without-recovery; with-recovery: %empty | with-recovery item | with-recovery error { std::cerr << "caught error\n"; } ; without-recovery: %empty | without-recovery item ; item: 'a' | 's' { throw syntax_error ("invalid expression"); } %% void yy::parser::error (const std::string &m) { std::cerr << "error: " << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF # Another file to check syntax_error's linkage. cat >scan.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include // getchar #include "input.hh" // 'a': valid item, 's': syntax error, 'l': lexical error. int yylex (yy::parser::semantic_type *lval) { switch (int res = getchar ()) { // Don't choke on echo's \n. case '\n': return yylex (lval); case 'l': throw yy::parser::syntax_error ("invalid character"); default: 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:1043: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1043" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1043" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1043: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:1043" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1043" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1043: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1043" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1043" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1043: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1043" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1043" $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:1043: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:1043" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1043" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:1043" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1043" { set +x $as_echo "$at_srcdir/c++.at:1043: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc scan.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc scan.cc $LIBS" "c++.at:1043" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc scan.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:1043" $at_failed && at_fn_log_failure $at_traceon; } # Leave enough valid tokens to make sure we recovered from the # previous error, otherwise we might hide some error messages # (discarded during error recoevery). echo "asaaalaa" >in { set +x $as_echo "$at_srcdir/c++.at:1043: \$PREPARSER ./input < in" at_fn_check_prepare_dynamic " $PREPARSER ./input < in" "c++.at:1043" ( $at_check_trace; $PREPARSER ./input < in ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1043" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1043: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1043" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "error: invalid expression caught error error: invalid character caught error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1043" $at_failed && at_fn_log_failure $at_traceon; } echo "!as" >in { set +x $as_echo "$at_srcdir/c++.at:1043: \$PREPARSER ./input < in" at_fn_check_prepare_dynamic " $PREPARSER ./input < in" "c++.at:1043" ( $at_check_trace; $PREPARSER ./input < in ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1043" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1043: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1043" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "error: invalid expression " | \ $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:1043" $at_failed && at_fn_log_failure $at_traceon; } echo "!al" >in { set +x $as_echo "$at_srcdir/c++.at:1043: \$PREPARSER ./input < in" at_fn_check_prepare_dynamic " $PREPARSER ./input < in" "c++.at:1043" ( $at_check_trace; $PREPARSER ./input < in ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1043" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1043: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1043" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "error: invalid character " | \ $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:1043" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save # AT_FOR_EACH_CXX set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_560 #AT_START_561 at_fn_group_banner 561 'c++.at:1044' \ "Syntax error as exception: glr.cc" " " 24 at_xfail=no ( $as_echo "561. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.cc" %defines %code { #include int yylex (yy::parser::semantic_type *); } %define parse.error verbose %define parse.trace %% start: with-recovery | '!' without-recovery; with-recovery: %empty | with-recovery item | with-recovery error { std::cerr << "caught error\n"; } ; without-recovery: %empty | without-recovery item ; item: 'a' | 's' { throw syntax_error ("invalid expression"); } %% void yy::parser::error (const std::string &m) { std::cerr << "error: " << m << '\n'; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; int debug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) debug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) debug |= 2; p.set_debug_level (debug); return p.parse (); } _ATEOF # Another file to check syntax_error's linkage. cat >scan.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include // getchar #include "input.hh" // 'a': valid item, 's': syntax error, 'l': lexical error. int yylex (yy::parser::semantic_type *lval) { switch (int res = getchar ()) { // Don't choke on echo's \n. case '\n': return yylex (lval); case 'l': throw yy::parser::syntax_error ("invalid character"); default: 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:1044: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1044" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1044" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1044: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:1044" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1044" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1044: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1044" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1044" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1044: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1044" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1044" $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:1044: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:1044" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1044" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:1044" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1044" { set +x $as_echo "$at_srcdir/c++.at:1044: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o input input.cc scan.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc scan.cc $LIBS" "c++.at:1044" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o input input.cc scan.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:1044" $at_failed && at_fn_log_failure $at_traceon; } # Leave enough valid tokens to make sure we recovered from the # previous error, otherwise we might hide some error messages # (discarded during error recoevery). echo "asaaalaa" >in { set +x $as_echo "$at_srcdir/c++.at:1044: \$PREPARSER ./input < in" at_fn_check_prepare_dynamic " $PREPARSER ./input < in" "c++.at:1044" ( $at_check_trace; $PREPARSER ./input < in ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1044" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1044: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1044" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "error: invalid expression caught error error: invalid character caught error " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1044" $at_failed && at_fn_log_failure $at_traceon; } echo "!as" >in { set +x $as_echo "$at_srcdir/c++.at:1044: \$PREPARSER ./input < in" at_fn_check_prepare_dynamic " $PREPARSER ./input < in" "c++.at:1044" ( $at_check_trace; $PREPARSER ./input < in ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1044" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1044: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1044" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "error: invalid expression " | \ $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:1044" $at_failed && at_fn_log_failure $at_traceon; } echo "!al" >in { set +x $as_echo "$at_srcdir/c++.at:1044: \$PREPARSER ./input < in" at_fn_check_prepare_dynamic " $PREPARSER ./input < in" "c++.at:1044" ( $at_check_trace; $PREPARSER ./input < in ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1044" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1044: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1044" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "error: invalid character " | \ $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:1044" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save # AT_FOR_EACH_CXX set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_561 #AT_START_562 at_fn_group_banner 562 'c++.at:1338' \ "Exception safety with error recovery " " " 24 at_xfail=no ( $as_echo "562. $at_setup_line: testing $at_desc ..." $at_traceon cat >exceptions.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include #include void foo () { try { throw std::runtime_error ("foo"); } catch (...) { std::cerr << "Inner caught\n"; throw; } } int main () { try { foo (); } catch (...) { std::cerr << "Outer caught\n"; return 0; } return 1; } _ATEOF $as_echo "c++.at:1338" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1338" { set +x $as_echo "$at_srcdir/c++.at:1338: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exceptions exceptions.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exceptions exceptions.cc $LIBS" "c++.at:1338" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exceptions exceptions.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:1338" $at_failed && at_fn_log_failure $at_traceon; } # The "empty" quadrigraph is to protect from cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:1338: ./exceptions || exit 77" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; ./exceptions || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1338" $at_failed && at_fn_log_failure $at_traceon; } cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %debug %define parse.error verbose %code requires { #include #include // size_t and getenv. #include #include #include bool debug = false; /// A class that tracks its instances. struct Object { char val; Object () : val ('?') { log (this, "Object::Object"); Object::instances.insert (this); } Object (const Object& that) : val (that.val) { log (this, "Object::Object"); Object::instances.insert (this); } Object (char v) : val (v) { log (this, "Object::Object"); Object::instances.insert (this); } ~Object () { log (this, "Object::~Object"); objects::iterator i = instances.find (this); // Make sure this object is alive. assert (i != instances.end ()); Object::instances.erase (i); } Object& operator= (const Object& that) { val = that.val; return *this; } Object& operator= (char v) { val = v; return *this; } // Static part. typedef std::set objects; static objects instances; static bool empty () { return instances.empty (); } static void log (Object const *o, const std::string& msg) { if (debug) { if (o) std::cerr << o << "->"; std::cerr << msg << " {"; const char* sep = " "; for (objects::const_iterator i = instances.begin(), i_end = instances.end(); i != i_end; ++i) { std::cerr << sep << *i; sep = ", "; } std::cerr << " }\n"; } } }; } %code { #include #include // strchr #include int yylex (yy::parser::semantic_type *); Object::objects Object::instances; static char const *input; } %union { Object *obj; } %destructor { delete $$; } ; %printer { yyo << $$ << " '" << $$->val << '\''; if ($$->val == 'p') throw std::runtime_error ("printer"); } ; %token 'a' 'E' 'e' 'p' 'R' 's' 'T' %type list item %initial-action { if (strchr (input, 'i')) throw std::runtime_error ("initial-action"); } %% start: list { delete $1; }; list: item { $$ = $1; } // Right recursion to load the stack. | item list { $$ = $1; delete $2; } ; item: 'a' { $$ = $1; } | 'e' { YYUSE ($$); YYUSE ($1); error ("syntax error"); } // Not just 'E', otherwise we reduce when 'E' is the lookahead, and // then the stack is emptied, defeating the point of the test. | 'E' 'a' { YYUSE ($1); $$ = $2; } | 'R' { $$ = YY_NULLPTR; delete $1; YYERROR; } | 'p' { $$ = $1; } | 's' { $$ = $1; throw std::runtime_error ("reduction"); } | 'T' { $$ = YY_NULLPTR; delete $1; YYABORT; } | error { $$ = new Object ('R'); yyerrok; } ; %% int yylex (yy::parser::semantic_type *lvalp) { // 'a': no error. // 'e': user action calls error. // 'E': syntax error, with yyerror that throws. // 'i': initial action throws. // 'l': yylex throws. // 'R': call YYERROR in the action // 's': reduction throws. // 'T': call YYABORT in the action switch (char res = *input++) { case 'l': throw std::runtime_error ("yylex"); default: lvalp->obj = new Object (res); goto zero; zero: case 0: return res; } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { throw std::runtime_error (m); } int main (int argc, const char *argv[]) { switch (argc) { case 2: input = argv[1]; break; case 3: assert (std::string(argv[1]) == "--debug"); debug = 1; input = argv[2]; break; default: abort (); } yy::parser parser; debug |= !!getenv ("YYDEBUG"); parser.set_debug_level (debug); int res = 2; try { res = parser.parse (); } catch (const std::exception& e) { std::cerr << "exception caught: " << e.what () << '\n'; } catch (...) { std::cerr << "unknown exception caught\n"; } Object::log (YY_NULLPTR, "end"); assert (Object::empty()); return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:1338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc --report=all input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:1338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1338" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1338" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1338: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1338" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1338" $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:1338: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc --report=all input.yy" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1338" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:1338" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1338" { set +x $as_echo "$at_srcdir/c++.at:1338: \$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:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input aaaas" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input aaaal" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input i" at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; 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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input --debug aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: grep '^exception caught: printer\$' stderr" at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input aaaae" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input aaaaE" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input aaaaT" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; 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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: \$PREPARSER ./input aaaaR" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:1338" ( $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:1338" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1338" ( $at_check_trace; 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:1338" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_562 #AT_START_563 at_fn_group_banner 563 'c++.at:1339' \ "Exception safety without error recovery " " " 24 at_xfail=no ( $as_echo "563. $at_setup_line: testing $at_desc ..." $at_traceon cat >exceptions.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include #include void foo () { try { throw std::runtime_error ("foo"); } catch (...) { std::cerr << "Inner caught\n"; throw; } } int main () { try { foo (); } catch (...) { std::cerr << "Outer caught\n"; return 0; } return 1; } _ATEOF $as_echo "c++.at:1339" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1339" { set +x $as_echo "$at_srcdir/c++.at:1339: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exceptions exceptions.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exceptions exceptions.cc $LIBS" "c++.at:1339" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exceptions exceptions.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:1339" $at_failed && at_fn_log_failure $at_traceon; } # The "empty" quadrigraph is to protect from cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:1339: ./exceptions || exit 77" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; ./exceptions || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1339" $at_failed && at_fn_log_failure $at_traceon; } cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %debug %define parse.error verbose %code requires { #include #include // size_t and getenv. #include #include #include bool debug = false; /// A class that tracks its instances. struct Object { char val; Object () : val ('?') { log (this, "Object::Object"); Object::instances.insert (this); } Object (const Object& that) : val (that.val) { log (this, "Object::Object"); Object::instances.insert (this); } Object (char v) : val (v) { log (this, "Object::Object"); Object::instances.insert (this); } ~Object () { log (this, "Object::~Object"); objects::iterator i = instances.find (this); // Make sure this object is alive. assert (i != instances.end ()); Object::instances.erase (i); } Object& operator= (const Object& that) { val = that.val; return *this; } Object& operator= (char v) { val = v; return *this; } // Static part. typedef std::set objects; static objects instances; static bool empty () { return instances.empty (); } static void log (Object const *o, const std::string& msg) { if (debug) { if (o) std::cerr << o << "->"; std::cerr << msg << " {"; const char* sep = " "; for (objects::const_iterator i = instances.begin(), i_end = instances.end(); i != i_end; ++i) { std::cerr << sep << *i; sep = ", "; } std::cerr << " }\n"; } } }; } %code { #include #include // strchr #include int yylex (yy::parser::semantic_type *); Object::objects Object::instances; static char const *input; } %union { Object *obj; } %destructor { delete $$; } ; %printer { yyo << $$ << " '" << $$->val << '\''; if ($$->val == 'p') throw std::runtime_error ("printer"); } ; %token 'a' 'E' 'e' 'p' 'R' 's' 'T' %type list item %initial-action { if (strchr (input, 'i')) throw std::runtime_error ("initial-action"); } %% start: list { delete $1; }; list: item { $$ = $1; } // Right recursion to load the stack. | item list { $$ = $1; delete $2; } ; item: 'a' { $$ = $1; } | 'e' { YYUSE ($$); YYUSE ($1); error ("syntax error"); } // Not just 'E', otherwise we reduce when 'E' is the lookahead, and // then the stack is emptied, defeating the point of the test. | 'E' 'a' { YYUSE ($1); $$ = $2; } | 'R' { $$ = YY_NULLPTR; delete $1; YYERROR; } | 'p' { $$ = $1; } | 's' { $$ = $1; throw std::runtime_error ("reduction"); } | 'T' { $$ = YY_NULLPTR; delete $1; YYABORT; } ; %% int yylex (yy::parser::semantic_type *lvalp) { // 'a': no error. // 'e': user action calls error. // 'E': syntax error, with yyerror that throws. // 'i': initial action throws. // 'l': yylex throws. // 'R': call YYERROR in the action // 's': reduction throws. // 'T': call YYABORT in the action switch (char res = *input++) { case 'l': throw std::runtime_error ("yylex"); default: lvalp->obj = new Object (res); goto zero; zero: case 0: return res; } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { throw std::runtime_error (m); } int main (int argc, const char *argv[]) { switch (argc) { case 2: input = argv[1]; break; case 3: assert (std::string(argv[1]) == "--debug"); debug = 1; input = argv[2]; break; default: abort (); } yy::parser parser; debug |= !!getenv ("YYDEBUG"); parser.set_debug_level (debug); int res = 2; try { res = parser.parse (); } catch (const std::exception& e) { std::cerr << "exception caught: " << e.what () << '\n'; } catch (...) { std::cerr << "unknown exception caught\n"; } Object::log (YY_NULLPTR, "end"); assert (Object::empty()); return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:1339: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc --report=all input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1339" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:1339" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1339" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1339: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1339" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1339" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1339: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1339" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1339" $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:1339: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc --report=all input.yy" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1339" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:1339" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1339" { set +x $as_echo "$at_srcdir/c++.at:1339: \$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:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input aaaas" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input aaaal" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input i" at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; 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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input --debug aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: grep '^exception caught: printer\$' stderr" at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input aaaae" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input aaaaE" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input aaaaT" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:1339" ( $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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; 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:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: \$PREPARSER ./input aaaaR" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:1339" ( $at_check_trace; $PREPARSER ./input aaaaR ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/c++.at:1339" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1339: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1339" ( $at_check_trace; 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:1339" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_563 #AT_START_564 at_fn_group_banner 564 'c++.at:1340' \ "Exception safety with error recovery api.value.type=variant" "" 24 at_xfail=no ( $as_echo "564. $at_setup_line: testing $at_desc ..." $at_traceon cat >exceptions.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include #include void foo () { try { throw std::runtime_error ("foo"); } catch (...) { std::cerr << "Inner caught\n"; throw; } } int main () { try { foo (); } catch (...) { std::cerr << "Outer caught\n"; return 0; } return 1; } _ATEOF $as_echo "c++.at:1340" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1340" { set +x $as_echo "$at_srcdir/c++.at:1340: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exceptions exceptions.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exceptions exceptions.cc $LIBS" "c++.at:1340" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exceptions exceptions.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:1340" $at_failed && at_fn_log_failure $at_traceon; } # The "empty" quadrigraph is to protect from cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:1340: ./exceptions || exit 77" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; ./exceptions || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1340" $at_failed && at_fn_log_failure $at_traceon; } cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %debug %define parse.error verbose %define api.value.type variant %code requires { #include #include // size_t and getenv. #include #include #include bool debug = false; /// A class that tracks its instances. struct Object { char val; Object () : val ('?') { log (this, "Object::Object"); Object::instances.insert (this); } Object (const Object& that) : val (that.val) { log (this, "Object::Object"); Object::instances.insert (this); } Object (char v) : val (v) { log (this, "Object::Object"); Object::instances.insert (this); } ~Object () { log (this, "Object::~Object"); objects::iterator i = instances.find (this); // Make sure this object is alive. assert (i != instances.end ()); Object::instances.erase (i); } Object& operator= (const Object& that) { val = that.val; return *this; } Object& operator= (char v) { val = v; return *this; } // Static part. typedef std::set objects; static objects instances; static bool empty () { return instances.empty (); } static void log (Object const *o, const std::string& msg) { if (debug) { if (o) std::cerr << o << "->"; std::cerr << msg << " {"; const char* sep = " "; for (objects::const_iterator i = instances.begin(), i_end = instances.end(); i != i_end; ++i) { std::cerr << sep << *i; sep = ", "; } std::cerr << " }\n"; } } }; } %code { #include #include // strchr #include int yylex (yy::parser::semantic_type *); Object::objects Object::instances; static char const *input; } %printer { yyo << &$$ << " '" << $$.val << '\''; if ($$.val == 'p') throw std::runtime_error ("printer"); } ; %token 'a' 'E' 'e' 'p' 'R' 's' 'T' %type list item %initial-action { if (strchr (input, 'i')) throw std::runtime_error ("initial-action"); } %% start: list {}; list: item { $$ = $1; } // Right recursion to load the stack. | item list { $$ = $1; } ; item: 'a' { $$ = $1; } | 'e' { YYUSE ($$); YYUSE ($1); error ("syntax error"); } // Not just 'E', otherwise we reduce when 'E' is the lookahead, and // then the stack is emptied, defeating the point of the test. | 'E' 'a' { YYUSE ($1); $$ = $2; } | 'R' { YYERROR; } | 'p' { $$ = $1; } | 's' { $$ = $1; throw std::runtime_error ("reduction"); } | 'T' { YYABORT; } | error { $$ = Object ('R'); yyerrok; } ; %% int yylex (yy::parser::semantic_type *lvalp) { // 'a': no error. // 'e': user action calls error. // 'E': syntax error, with yyerror that throws. // 'i': initial action throws. // 'l': yylex throws. // 'R': call YYERROR in the action // 's': reduction throws. // 'T': call YYABORT in the action switch (char res = *input++) { case 'l': throw std::runtime_error ("yylex"); default: lvalp->build (res); goto zero; zero: case 0: return res; } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { throw std::runtime_error (m); } int main (int argc, const char *argv[]) { switch (argc) { case 2: input = argv[1]; break; case 3: assert (std::string(argv[1]) == "--debug"); debug = 1; input = argv[2]; break; default: abort (); } yy::parser parser; debug |= !!getenv ("YYDEBUG"); parser.set_debug_level (debug); int res = 2; try { res = parser.parse (); } catch (const std::exception& e) { std::cerr << "exception caught: " << e.what () << '\n'; } catch (...) { std::cerr << "unknown exception caught\n"; } Object::log (YY_NULLPTR, "end"); assert (Object::empty()); return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:1340: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc --report=all input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:1340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1340" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1340: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1340" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1340" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1340: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1340" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1340" $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:1340: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc --report=all input.yy" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1340" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:1340" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1340" { set +x $as_echo "$at_srcdir/c++.at:1340: \$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:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input aaaas" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input aaaal" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input i" at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; 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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input --debug aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: grep '^exception caught: printer\$' stderr" at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input aaaae" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input aaaaE" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input aaaaT" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; 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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: \$PREPARSER ./input aaaaR" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:1340" ( $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:1340" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1340" ( $at_check_trace; 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:1340" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_564 #AT_START_565 at_fn_group_banner 565 'c++.at:1341' \ "Exception safety without error recovery api.value.type=variant" "" 24 at_xfail=no ( $as_echo "565. $at_setup_line: testing $at_desc ..." $at_traceon cat >exceptions.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include #include void foo () { try { throw std::runtime_error ("foo"); } catch (...) { std::cerr << "Inner caught\n"; throw; } } int main () { try { foo (); } catch (...) { std::cerr << "Outer caught\n"; return 0; } return 1; } _ATEOF $as_echo "c++.at:1341" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1341" { set +x $as_echo "$at_srcdir/c++.at:1341: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o exceptions exceptions.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exceptions exceptions.cc $LIBS" "c++.at:1341" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o exceptions exceptions.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:1341" $at_failed && at_fn_log_failure $at_traceon; } # The "empty" quadrigraph is to protect from cfg.mk's sc_at_parser_check. { set +x $as_echo "$at_srcdir/c++.at:1341: ./exceptions || exit 77" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; ./exceptions || exit 77 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1341" $at_failed && at_fn_log_failure $at_traceon; } cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %debug %define parse.error verbose %define api.value.type variant %code requires { #include #include // size_t and getenv. #include #include #include bool debug = false; /// A class that tracks its instances. struct Object { char val; Object () : val ('?') { log (this, "Object::Object"); Object::instances.insert (this); } Object (const Object& that) : val (that.val) { log (this, "Object::Object"); Object::instances.insert (this); } Object (char v) : val (v) { log (this, "Object::Object"); Object::instances.insert (this); } ~Object () { log (this, "Object::~Object"); objects::iterator i = instances.find (this); // Make sure this object is alive. assert (i != instances.end ()); Object::instances.erase (i); } Object& operator= (const Object& that) { val = that.val; return *this; } Object& operator= (char v) { val = v; return *this; } // Static part. typedef std::set objects; static objects instances; static bool empty () { return instances.empty (); } static void log (Object const *o, const std::string& msg) { if (debug) { if (o) std::cerr << o << "->"; std::cerr << msg << " {"; const char* sep = " "; for (objects::const_iterator i = instances.begin(), i_end = instances.end(); i != i_end; ++i) { std::cerr << sep << *i; sep = ", "; } std::cerr << " }\n"; } } }; } %code { #include #include // strchr #include int yylex (yy::parser::semantic_type *); Object::objects Object::instances; static char const *input; } %printer { yyo << &$$ << " '" << $$.val << '\''; if ($$.val == 'p') throw std::runtime_error ("printer"); } ; %token 'a' 'E' 'e' 'p' 'R' 's' 'T' %type list item %initial-action { if (strchr (input, 'i')) throw std::runtime_error ("initial-action"); } %% start: list {}; list: item { $$ = $1; } // Right recursion to load the stack. | item list { $$ = $1; } ; item: 'a' { $$ = $1; } | 'e' { YYUSE ($$); YYUSE ($1); error ("syntax error"); } // Not just 'E', otherwise we reduce when 'E' is the lookahead, and // then the stack is emptied, defeating the point of the test. | 'E' 'a' { YYUSE ($1); $$ = $2; } | 'R' { YYERROR; } | 'p' { $$ = $1; } | 's' { $$ = $1; throw std::runtime_error ("reduction"); } | 'T' { YYABORT; } ; %% int yylex (yy::parser::semantic_type *lvalp) { // 'a': no error. // 'e': user action calls error. // 'E': syntax error, with yyerror that throws. // 'i': initial action throws. // 'l': yylex throws. // 'R': call YYERROR in the action // 's': reduction throws. // 'T': call YYABORT in the action switch (char res = *input++) { case 'l': throw std::runtime_error ("yylex"); default: lvalp->build (res); goto zero; zero: case 0: return res; } } /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { throw std::runtime_error (m); } int main (int argc, const char *argv[]) { switch (argc) { case 2: input = argv[1]; break; case 3: assert (std::string(argv[1]) == "--debug"); debug = 1; input = argv[2]; break; default: abort (); } yy::parser parser; debug |= !!getenv ("YYDEBUG"); parser.set_debug_level (debug); int res = 2; try { res = parser.parse (); } catch (const std::exception& e) { std::cerr << "exception caught: " << e.what () << '\n'; } catch (...) { std::cerr << "unknown exception caught\n"; } Object::log (YY_NULLPTR, "end"); assert (Object::empty()); return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:1341: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc --report=all input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1341" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy" "c++.at:1341" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1341" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1341: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1341" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1341" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1341: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1341" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1341" $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:1341: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc --report=all input.yy" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc --report=all input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1341" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:1341" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1341" { set +x $as_echo "$at_srcdir/c++.at:1341: \$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:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input aaaas" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaas" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input aaaal" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaal" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input i" at_fn_check_prepare_dynamic " $PREPARSER ./input i" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaap" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; 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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input --debug aaaap" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug aaaap" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: grep '^exception caught: printer\$' stderr" at_fn_check_prepare_dynamic "grep '^exception caught: printer$' stderr" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input aaaae" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaae" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input aaaaE" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaE" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input aaaaT" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaT" "c++.at:1341" ( $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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; 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:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: \$PREPARSER ./input aaaaR" at_fn_check_prepare_dynamic " $PREPARSER ./input aaaaR" "c++.at:1341" ( $at_check_trace; $PREPARSER ./input aaaaR ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/c++.at:1341" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1341" ( $at_check_trace; 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:1341" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_565 #AT_START_566 at_fn_group_banner 566 'c++.at:1349' \ "C++ GLR parser identifier shadowing" " " 24 at_xfail=no ( $as_echo "566. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "glr.cc" %union { int ival; } %token ZERO; %code { int yylex (yy::parser::semantic_type *lvalp); } %% exp: ZERO %% int yylex (yy::parser::semantic_type *lvalp) { // Note: this argument is unused, but named on purpose. There used to be a // bug with a macro that erroneously expanded this identifier to // yystackp->yyval. YYUSE (lvalp); return yy::parser::token::ZERO; } void yy::parser::error (std::string const&) {} int main () {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/c++.at:1388: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.cc input.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1388" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:1388" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1388: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy" "c++.at:1388" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1388" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1388: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1388" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1388" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1388: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1388" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1388" $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:1388: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy" at_fn_check_prepare_trace "c++.at:1388" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.cc input.yy ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1388" $at_failed && at_fn_log_failure $at_traceon; } at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" $as_echo "c++.at:1389" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1389" { set +x $as_echo "$at_srcdir/c++.at:1389: \$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:1389" ( $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:1389" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_566 #AT_START_567 at_fn_group_banner 567 'c++.at:1400' \ "Shared locations" " " 24 at_xfail=no ( $as_echo "567. $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 after applying api.prefix. Check # that headers can be compiled by a C++ compiler. mkdir -p include/ast cat >x1.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %define api.namespace {x1} %defines %locations %define api.location.file "include/ast/loc.hh" %define api.location.include {} %code { static int yylex (x1::parser::semantic_type *lvalp, x1::parser::location_type *llocp); } %% exp: '0'; %% /* A C++ error reporting function. */ void x1::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (x1::parser::semantic_type *lvalp, x1::parser::location_type *llocp) { static char const input[] = "0"; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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/c++.at:1438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -o x1.cc x1.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -o x1.cc x1.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:1438" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1438: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o x1.cc x1.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o x1.cc x1.yy" "c++.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o x1.cc x1.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:1438" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1438: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1438" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1438" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1438: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1438" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1438" $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:1438: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o x1.cc x1.yy" at_fn_check_prepare_trace "c++.at:1438" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o x1.cc x1.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:1438" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:1438" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1438" { set +x $as_echo "$at_srcdir/c++.at:1438: \$CXX \$CXXFLAGS \$CPPFLAGS -Iinclude -c -o x1.o x1.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -Iinclude -c -o x1.o x1.cc " "c++.at:1438" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -Iinclude -c -o x1.o x1.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/c++.at:1438" $at_failed && at_fn_log_failure $at_traceon; } # Check the CPP guard and Doxyen comments. { set +x $as_echo "$at_srcdir/c++.at:1447: sed -ne '/INCLUDED/p;/\\\\file/{p;n;p;}' include/ast/loc.hh" at_fn_check_prepare_trace "c++.at:1447" ( $at_check_trace; sed -ne '/INCLUDED/p;/\\file/{p;n;p;}' include/ast/loc.hh ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo " ** \\file ast/loc.hh ** Define the x1::location class. #ifndef YY_YY_AST_LOC_HH_INCLUDED # define YY_YY_AST_LOC_HH_INCLUDED #endif // !YY_YY_AST_LOC_HH_INCLUDED " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1447" $at_failed && at_fn_log_failure $at_traceon; } cat >x2.yy <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %skeleton "lalr1.cc" %define api.namespace {x2} %defines %locations %code requires {#include } %define api.location.type {x1::location} %code { static int yylex (x2::parser::semantic_type *lvalp, x2::parser::location_type *llocp); } %% exp: '0'; %% /* A C++ error reporting function. */ void x2::parser::error (const location_type& l, const std::string& m) { std::cerr << l << ": " << m << '\n'; } #include static int yylex (x2::parser::semantic_type *lvalp, x2::parser::location_type *llocp) { static char const input[] = "0"; static int toknum = 0; int res; (void) lvalp;(void) llocp; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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/c++.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -o x2.cc x2.yy" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -o x2.cc x2.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:1453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o x2.cc x2.yy" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o x2.cc x2.yy" "c++.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o x2.cc x2.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:1453" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1453" $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:1453: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o x2.cc x2.yy" at_fn_check_prepare_trace "c++.at:1453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o x2.cc x2.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:1453" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:1453" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1453" { set +x $as_echo "$at_srcdir/c++.at:1453: \$CXX \$CXXFLAGS \$CPPFLAGS -Iinclude -c -o x2.o x2.cc " at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -Iinclude -c -o x2.o x2.cc " "c++.at:1453" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -Iinclude -c -o x2.o x2.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/c++.at:1453" $at_failed && at_fn_log_failure $at_traceon; } cat >main.cc <<'_ATEOF' /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include #include "x1.hh" #include "x2.hh" #define RUN(S) \ do { \ S::parser parser; \ int res = parser.parse(); \ if (res) \ std::cerr << #S": " << res << '\n'; \ } while (false) int main (void) { RUN(x1); RUN(x2); } _ATEOF # main.cc $as_echo "c++.at:1479" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1479" { set +x $as_echo "$at_srcdir/c++.at:1479: \$CXX \$CXXFLAGS \$CPPFLAGS -Iinclude \$LDFLAGS -o parser x[12].o main.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS -Iinclude $LDFLAGS -o parser x[12].o main.cc $LIBS" "c++.at:1479" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS -Iinclude $LDFLAGS -o parser x[12].o 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/c++.at:1479" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1480: \$PREPARSER ./parser" at_fn_check_prepare_dynamic " $PREPARSER ./parser" "c++.at:1480" ( $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_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1480" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1480: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1480" ( $at_check_trace; 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:1480" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_567 #AT_START_568 at_fn_group_banner 568 'c++.at:1495' \ "Default action" " " 24 at_xfail=no ( $as_echo "568. $at_setup_line: testing $at_desc ..." $at_traceon cat >test.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %code requires { #include // unique_ptr } %code { static yy::parser::symbol_type yylex (); } %skeleton "lalr1.cc" %define api.token.constructor %define api.value.type variant %define api.value.automove %token ONE TWO EOI 0 %type > ONE TWO one two one.opt two.opt %% exp: one.opt two.opt { std::cout << *$1 << ", " << *$2 << '\n'; } one.opt: one | %empty {} two.opt: two | %empty {} one: ONE two: TWO %% /* A C++ error reporting function. */ void yy::parser::error (const std::string& m) { std::cerr << m << '\n'; } #include static yy::parser::symbol_type yylex () { static char const input[] = "12"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; if (res == '1') return yy::parser::make_ONE (std::make_unique (10)); else if (res == '2') return yy::parser::make_TWO (std::make_unique (20)); else return yy::parser::make_EOI (); ; } #include // getenv. #include // strcmp. int main (int argc, char const* argv[]) { yy::parser p; (void) argc; (void) argv; return p.parse (); } _ATEOF at_for_each_std_CXXFLAGS_save=$CXXFLAGS for at_std in '' \ ${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \ ${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \ ${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \ ${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \ ${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \ ${CXX2A_CXXFLAGS:+"$CXX2A_CXXFLAGS"} do $as_echo "======== Testing with C++ standard flags: '$at_cxx_std'" CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std" cat >check.cc <<'_ATEOF' int main () { #if !defined __cplusplus || __cplusplus < 201402 return 1; #else return 0; #endif } _ATEOF $as_echo "c++.at:1538" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1538" { set +x $as_echo "$at_srcdir/c++.at:1538: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o check check.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.cc $LIBS" "c++.at:1538" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o check check.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:1538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1538: ./check" at_fn_check_prepare_trace "c++.at:1538" ( $at_check_trace; ./check ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/c++.at:1538" $at_failed && at_fn_log_failure $at_traceon; } if test $at_status != 0; then echo "$at_std not supported"; continue 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/c++.at:1538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -fcaret -o test.cc test.y" at_fn_check_prepare_notrace 'an embedded newline' "c++.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -fcaret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o test.cc test.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o test.cc test.y" "c++.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1538" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/c++.at:1538: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1538" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1538" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/c++.at:1538: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1538" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1538" $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:1538: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o test.cc test.y" at_fn_check_prepare_trace "c++.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -fcaret -o test.cc test.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1538" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "c++.at:1538" >"$at_check_line_file" (! $BISON_CXX_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/c++.at:1538" { set +x $as_echo "$at_srcdir/c++.at:1538: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS -o test test.cc \$LIBS" at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS" "c++.at:1538" ( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1538: \$PREPARSER ./test" at_fn_check_prepare_dynamic " $PREPARSER ./test" "c++.at:1538" ( $at_check_trace; $PREPARSER ./test ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "10, 20 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/c++.at:1538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/c++.at:1538: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "c++.at:1538" ( $at_check_trace; 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:1538" $at_failed && at_fn_log_failure $at_traceon; } done CXXFLAGS=$at_for_each_std_CXXFLAGS_save set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_568 #AT_START_569 at_fn_group_banner 569 'java.at:25' \ "Java invalid directives" " " 25 at_xfail=no ( $as_echo "569. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %defines %destructor { /* Nothing. */ } exp %% exp: _ATEOF { set +x $as_echo "$at_srcdir/java.at:40: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret YYParser.y" "java.at:40" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "YYParser.y: error: %defines does not make sense in Java YYParser.y:4.13-30: error: %destructor does not make sense in Java 4 | %destructor { /* Nothing. */ } exp | ^~~~~~~~~~~~~~~~~~ " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/java.at:40" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_569 #AT_START_570 at_fn_group_banner 570 'java.at:351' \ "Calculator " " " 25 at_xfail=no ( $as_echo "570. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.prefix {Calc} %define api.parser.class {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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } public void yyerror (String m) { System.err.println (m); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); if (ttype == st.TT_EOF) return EOF; else if (ttype == st.TT_EOL) { return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return NUM; } else return st.ttype; } } class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:351" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:351" $as_echo "java.at:351" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:351" { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:351" ( $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:351" $at_failed && at_fn_log_failure $at_traceon; } # Test the precedences. 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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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_570 #AT_START_571 at_fn_group_banner 571 'java.at:351' \ "Calculator parse.error=verbose " " " 25 at_xfail=no ( $as_echo "571. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.prefix {Calc} %define api.parser.class {Calc} %define public %define parse.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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } public void yyerror (String m) { System.err.println (m); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); if (ttype == st.TT_EOF) return EOF; else if (ttype == st.TT_EOL) { return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return NUM; } else return st.ttype; } } class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:351" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:351" $as_echo "java.at:351" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:351" { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:351" ( $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:351" $at_failed && at_fn_log_failure $at_traceon; } # Test the precedences. 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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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_571 #AT_START_572 at_fn_group_banner 572 'java.at:351' \ "Calculator %locations " " " 25 at_xfail=no ( $as_echo "572. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.prefix {Calc} %define api.parser.class {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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public void yyerror (Calc.Location l, String m) { if (l == null) System.err.println (m); else System.err.println (l + ": " + m); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); yypos = new Position (yypos.lineno (), yypos.token () + 1); if (ttype == st.TT_EOF) return EOF; else if (ttype == st.TT_EOL) { yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return NUM; } else return st.ttype; } } class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:351" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:351" $as_echo "java.at:351" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:351" { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:351" ( $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:351" $at_failed && at_fn_log_failure $at_traceon; } # Test the precedences. 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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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_572 #AT_START_573 at_fn_group_banner 573 'java.at:351' \ "Calculator parse.error=verbose %locations " " " 25 at_xfail=no ( $as_echo "573. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.prefix {Calc} %define api.parser.class {Calc} %define public %define parse.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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %% class CalcLexer implements Calc.Lexer { StreamTokenizer st; public CalcLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public void yyerror (Calc.Location l, String m) { if (l == null) System.err.println (m); else System.err.println (l + ": " + m); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); yypos = new Position (yypos.lineno (), yypos.token () + 1); if (ttype == st.TT_EOF) return EOF; else if (ttype == st.TT_EOL) { yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return NUM; } else return st.ttype; } } class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:351" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:351" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:351" $as_echo "java.at:351" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:351" { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:351" ( $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:351" $at_failed && at_fn_log_failure $at_traceon; } # Test the precedences. 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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $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:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:351" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:351: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:351" ( $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:351" $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:351: cat stderr" at_fn_check_prepare_trace "java.at:351" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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_573 #AT_START_574 at_fn_group_banner 574 'java.at:358' \ "Calculator %lex-param { InputStream is } " " " 25 at_xfail=no ( $as_echo "574. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.prefix {Calc} %define api.parser.class {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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %code lexer { StreamTokenizer st; public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } public void yyerror (String m) { System.err.println (m); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); if (ttype == st.TT_EOF) return EOF; else if (ttype == st.TT_EOL) { return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return NUM; } else return st.ttype; } }; %% class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:358: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:358: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:358: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:358" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:358: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:358" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:358: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:358" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:358" $as_echo "java.at:358" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:358" { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:358" ( $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:358" $at_failed && at_fn_log_failure $at_traceon; } # Test the precedences. 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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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_574 #AT_START_575 at_fn_group_banner 575 'java.at:358' \ "Calculator parse.error=verbose %lex-param { InputStream is } " "" 25 at_xfail=no ( $as_echo "575. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.prefix {Calc} %define api.parser.class {Calc} %define public %define parse.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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %code lexer { StreamTokenizer st; public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } public void yyerror (String m) { System.err.println (m); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); if (ttype == st.TT_EOF) return EOF; else if (ttype == st.TT_EOL) { return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return NUM; } else return st.ttype; } }; %% class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:358: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:358: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:358: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:358" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:358: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:358" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:358: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:358" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:358" $as_echo "java.at:358" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:358" { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:358" ( $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:358" $at_failed && at_fn_log_failure $at_traceon; } # Test the precedences. 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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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_575 #AT_START_576 at_fn_group_banner 576 'java.at:358' \ "Calculator %locations %lex-param { InputStream is } " "" 25 at_xfail=no ( $as_echo "576. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.prefix {Calc} %define api.parser.class {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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %code lexer { StreamTokenizer st; public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public void yyerror (Calc.Location l, String m) { if (l == null) System.err.println (m); else System.err.println (l + ": " + m); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); yypos = new Position (yypos.lineno (), yypos.token () + 1); if (ttype == st.TT_EOF) return EOF; else if (ttype == st.TT_EOL) { yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return NUM; } else return st.ttype; } }; %% class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:358: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:358: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:358: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:358" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:358: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:358" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:358: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:358" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:358" $as_echo "java.at:358" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:358" { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:358" ( $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:358" $at_failed && at_fn_log_failure $at_traceon; } # Test the precedences. 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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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_576 #AT_START_577 at_fn_group_banner 577 'java.at:358' \ "Calculator parse.error=verbose %locations %lex-param { InputStream is } " "" 25 at_xfail=no ( $as_echo "577. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.prefix {Calc} %define api.parser.class {Calc} %define public %define parse.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 '*' '/' %precedence NEG /* negation--unary minus */ %right '^' /* exponentiation */ /* Grammar follows */ %% input: line | input line ; line: '\n' | exp '\n' | error '\n' ; exp: NUM { $$ = $1; } | exp '=' exp { if ($1.intValue () != $3.intValue ()) yyerror (@$, "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int) Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2; } | '(' error ')' { $$ = new Integer (1111); } | '!' { $$ = new Integer (0); return YYERROR; } | '-' error { $$ = new Integer (0); return YYERROR; } ; %code lexer { StreamTokenizer st; public YYLexer (InputStream is) { st = new StreamTokenizer (new InputStreamReader (is)); st.resetSyntax (); st.eolIsSignificant (true); st.whitespaceChars ('\t', '\t'); st.whitespaceChars (' ', ' '); st.wordChars ('0', '9'); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public void yyerror (Calc.Location l, String m) { if (l == null) System.err.println (m); else System.err.println (l + ": " + m); } Integer yylval; public Object getLVal() { return yylval; } public int yylex () throws IOException { int ttype = st.nextToken (); yypos = new Position (yypos.lineno (), yypos.token () + 1); if (ttype == st.TT_EOF) return EOF; else if (ttype == st.TT_EOL) { yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; } else if (ttype == st.TT_WORD) { yylval = new Integer (st.sval); return NUM; } else return st.ttype; } }; %% class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:358: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:358: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o Calc.java Calc.y" "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:358: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:358" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:358: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:358" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:358: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -o Calc.java Calc.y" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated -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:358" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:358" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:358" $as_echo "java.at:358" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:358" { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "java.at:358" ( $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:358" $at_failed && at_fn_log_failure $at_traceon; } # Test the precedences. 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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1//2 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' error _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' 1 = 2 = 3 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' +1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < /dev/null" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < /dev/null" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $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:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:358" $at_failed && at_fn_log_failure $at_traceon; } cat >input <<'_ATEOF' (- *) + (0 0) = 1 _ATEOF { set +x $as_echo "$at_srcdir/java.at:358: \$SHELL ../../../javaexec.sh Calc < input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc < input" "java.at:358" ( $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:358" $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:358: cat stderr" at_fn_check_prepare_trace "java.at:358" ( $at_check_trace; cat stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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_577 #AT_START_578 at_fn_group_banner 578 'java.at:439' \ "Java parser class and package names" " " 26 at_xfail=no ( $as_echo "578. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:441: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:441" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:441" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:441: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:441" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:441" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:441: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:441" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:441" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:441: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:441" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:441" $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:441: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:441" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:441" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:441: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:441" ( $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:441" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:441" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:441" $as_echo "java.at:441" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:441" { set +x $as_echo "$at_srcdir/java.at:441: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:441" ( $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:441" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:442: grep -c '^class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class YYParser$' YYParser.java" "java.at:442" ( $at_check_trace; grep -c '^class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:442" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %name-prefix "Prefix" %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:444: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:444" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:444" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:444: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:444" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:444" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:444: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:444" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:444" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:444: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:444" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:444" $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:444: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:444" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:444" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:444: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:444" ( $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:444" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:444" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:444" $as_echo "java.at:444" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:444" { set +x $as_echo "$at_srcdir/java.at:444: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:444" ( $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:444" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:445: grep -c '^class PrefixParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class PrefixParser$' YYParser.java" "java.at:445" ( $at_check_trace; grep -c '^class PrefixParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:445" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define api.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:447: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:447" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:447: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:447" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:447: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:447" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:447" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:447: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:447" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:447" $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:447: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:447" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:447: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:447" ( $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:447" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:447" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:447" $as_echo "java.at:447" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:447" { set +x $as_echo "$at_srcdir/java.at:447: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:447" ( $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:447" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:448: grep -c '^class PrefixParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class PrefixParser$' YYParser.java" "java.at:448" ( $at_check_trace; grep -c '^class PrefixParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:448" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define api.token.prefix {TOK_} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:450: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:450" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:450" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:450: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:450" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:450" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:450: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:450" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:450" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:450: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:450" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:450" $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:450: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:450" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:450" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:450: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:450" ( $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:450" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:450" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:450" $as_echo "java.at:450" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:450" { set +x $as_echo "$at_srcdir/java.at:450: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:450" ( $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:450" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:451: grep -c '^.*TOK_END.*\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^.*TOK_END.*$' YYParser.java" "java.at:451" ( $at_check_trace; grep -c '^.*TOK_END.*$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:451" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define api.parser.class {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:453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:453: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:453" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:453" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:453: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:453" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:453" $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:453: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:453" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:453: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:453" ( $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:453" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:453" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:453" $as_echo "java.at:453" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:453" { set +x $as_echo "$at_srcdir/java.at:453: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:453" ( $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:453" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:454: grep -c '^class ParserClassName\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class ParserClassName$' YYParser.java" "java.at:454" ( $at_check_trace; grep -c '^class ParserClassName$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:454" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define package {user_java_package} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:456: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:456" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:456" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:456: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:456" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:456" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:456: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:456" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:456" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:456: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:456" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:456" $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:456: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:456" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:456" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:456: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:456" ( $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:456" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:456" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:456" $as_echo "java.at:456" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:456" { set +x $as_echo "$at_srcdir/java.at:456: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:456" ( $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:456" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:457: grep -c '^package user_java_package;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^package user_java_package;$' YYParser.java" "java.at:457" ( $at_check_trace; grep -c '^package user_java_package;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:457" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_578 #AT_START_579 at_fn_group_banner 579 'java.at:466' \ "Java parser class modifiers" " " 26 at_xfail=no ( $as_echo "579. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define abstract %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:468: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:468" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:468" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:468: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:468" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:468" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:468: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:468" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:468" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:468: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:468" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:468" $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:468: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:468" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:468" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:468: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:468" ( $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:468" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:468" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:468" $as_echo "java.at:468" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:468" { set +x $as_echo "$at_srcdir/java.at:468: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:468" ( $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:468" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:469: grep -c '^abstract class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^abstract class YYParser$' YYParser.java" "java.at:469" ( $at_check_trace; grep -c '^abstract class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:469" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define final %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:471: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:471" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:471" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:471: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:471" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:471" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:471: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:471" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:471" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:471: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:471" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:471" $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:471: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:471" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:471" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:471: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:471" ( $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:471" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:471" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:471" $as_echo "java.at:471" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:471" { set +x $as_echo "$at_srcdir/java.at:471: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:471" ( $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:471" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:472: grep -c '^final class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^final class YYParser$' YYParser.java" "java.at:472" ( $at_check_trace; grep -c '^final class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:472" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define strictfp %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:474: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:474" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:474: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:474" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:474" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:474: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:474" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:474" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:474: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:474" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:474: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:474" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:474: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:474" ( $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:474" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:474" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:474" $as_echo "java.at:474" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:474" { set +x $as_echo "$at_srcdir/java.at:474: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:474" ( $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:474" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:475: grep -c '^strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^strictfp class YYParser$' YYParser.java" "java.at:475" ( $at_check_trace; grep -c '^strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:475" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define abstract %define strictfp %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:479: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:479" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:479" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:479: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:479" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:479" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:479: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:479" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:479" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:479: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:479" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:479" $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:479: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:479" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:479" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:479: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:479" ( $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:479" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:479" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:479" $as_echo "java.at:479" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:479" { set +x $as_echo "$at_srcdir/java.at:479: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:479" ( $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:479" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:480: grep -c '^abstract strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^abstract strictfp class YYParser$' YYParser.java" "java.at:480" ( $at_check_trace; grep -c '^abstract strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:480" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define final %define strictfp %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:484: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:484" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:484" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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.gv > expout { set +x $as_echo "$at_srcdir/java.at:484: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:484" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:484: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:484" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:484" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:484" $as_echo "java.at:484" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:484" { set +x $as_echo "$at_srcdir/java.at:484: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:484" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:484" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:485: grep -c '^final strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^final strictfp class YYParser$' YYParser.java" "java.at:485" ( $at_check_trace; grep -c '^final strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:485" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define public %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:487: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:487" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:487" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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.gv > expout { set +x $as_echo "$at_srcdir/java.at:487: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:487" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:487: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:487" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:487" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:487" $as_echo "java.at:487" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:487" { set +x $as_echo "$at_srcdir/java.at:487: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:487" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:487" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:488: grep -c '^public class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public class YYParser$' YYParser.java" "java.at:488" ( $at_check_trace; grep -c '^public class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:488" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define public %define abstract %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:492: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:492" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:492" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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.gv > expout { set +x $as_echo "$at_srcdir/java.at:492: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:492" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:493: grep -c '^public abstract class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public abstract class YYParser$' YYParser.java" "java.at:493" ( $at_check_trace; grep -c '^public abstract class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:493" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define public %define final %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:497: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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.gv > expout { set +x $as_echo "$at_srcdir/java.at:497: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:497" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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 final class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public final class YYParser$' YYParser.java" "java.at:498" ( $at_check_trace; grep -c '^public final class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:498" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define public %define strictfp %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:502: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:502" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:502" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:502: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:502" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:502" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:502: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:502" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:502" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:502: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:502" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:502" $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:502: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:502" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:502" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:502: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:502" ( $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:502" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:502" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:502" $as_echo "java.at:502" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:502" { set +x $as_echo "$at_srcdir/java.at:502: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:502" ( $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:502" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:503: grep -c '^public strictfp class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^public strictfp class YYParser$' YYParser.java" "java.at:503" ( $at_check_trace; grep -c '^public strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:503" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define public %define abstract %define strictfp %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:508: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:508" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:508: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:508" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:508" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:508: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:508" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:508" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:508: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "java.at:508" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:508" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:508: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:508" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:508: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:508" ( $at_check_trace; grep '[mb]4_' YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 1 $at_status "$at_srcdir/java.at:508" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:508" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:508" $as_echo "java.at:508" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:508" { set +x $as_echo "$at_srcdir/java.at:508: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:508" ( $at_check_trace; $SHELL ../../../javacomp.sh YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:508" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:509: 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:509" ( $at_check_trace; grep -c '^public abstract strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:509" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define public %define final %define strictfp %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:514: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:514" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:514: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:514" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:514: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:514" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:514" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:514: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:514" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:514" $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:514: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:514" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:514" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:514: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:514" ( $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:514" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:514" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:514" $as_echo "java.at:514" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:514" { set +x $as_echo "$at_srcdir/java.at:514: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:514" ( $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:514" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:515: 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:515" ( $at_check_trace; grep -c '^public final strictfp class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:515" $at_failed && at_fn_log_failure $at_traceon; } # FIXME: Can't do a Java compile because javacomp.sh is configured for 1.3 cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define annotations {/*@Deprecated @SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "deprecation"}) @SuppressWarnings(value={"unchecked", "deprecation"})*/} %define public %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:520: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:520" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:520" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:520: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:520" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:520" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:520: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:520" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:520" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:520: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:520" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:520" $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:520: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:520" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:520" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:520: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:520" ( $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:520" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:520" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:520" $as_echo "java.at:520" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:520" { set +x $as_echo "$at_srcdir/java.at:520: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:520" ( $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:520" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:521: grep -c '^/\\*@Deprecated @SuppressWarnings(\"unchecked\") @SuppressWarnings({\"unchecked\", \"deprecation\"}) @SuppressWarnings(value={\"unchecked\", \"deprecation\"})\\*/ public class YYParser\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^/\\*@Deprecated @SuppressWarnings(\"unchecked\") @SuppressWarnings({\"unchecked\", \"deprecation\"}) @SuppressWarnings(value={\"unchecked\", \"deprecation\"})\\*/ public class YYParser$' YYParser.java" "java.at:521" ( $at_check_trace; grep -c '^/\*@Deprecated @SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "deprecation"}) @SuppressWarnings(value={"unchecked", "deprecation"})\*/ public class YYParser$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:521" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_579 #AT_START_580 at_fn_group_banner 580 'java.at:530' \ "Java parser class extends and implements" " " 26 at_xfail=no ( $as_echo "580. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define extends {Thread} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:532: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:532" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:532: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:532" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:532" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:532: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:532" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:532" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:532: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:532" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:532" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:532: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:532" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:532: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:532" ( $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:532" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:532" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:532" $as_echo "java.at:532" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:532" { set +x $as_echo "$at_srcdir/java.at:532: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:532" ( $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:532" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:533: grep -c '^class YYParser extends Thread\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class YYParser extends Thread$' YYParser.java" "java.at:533" ( $at_check_trace; grep -c '^class YYParser extends Thread$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:533" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define implements {Cloneable} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:535: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:535" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:535: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:535" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:535" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:535: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:535" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:535" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:535: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:535" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:535" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:535: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:535" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:535: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:535" ( $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:535" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:535" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:535" $as_echo "java.at:535" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:535" { set +x $as_echo "$at_srcdir/java.at:535: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:535" ( $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:535" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:536: grep -c '^class YYParser implements Cloneable\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^class YYParser implements Cloneable$' YYParser.java" "java.at:536" ( $at_check_trace; grep -c '^class YYParser implements Cloneable$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:536" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define extends {Thread} %define implements {Cloneable} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:540: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:540" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:540" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:540: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:540" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:540" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:540: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:540" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:540" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:540: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:540" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:540" $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:540: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:540" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:540" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:540: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:540" ( $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:540" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:540" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:540" $as_echo "java.at:540" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:540" { set +x $as_echo "$at_srcdir/java.at:540: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:540" ( $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:540" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:541: 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:541" ( $at_check_trace; grep -c '^class YYParser extends Thread implements Cloneable$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:541" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_580 #AT_START_581 at_fn_group_banner 581 'java.at:550' \ "Java %parse-param and %lex-param" " " 26 at_xfail=no ( $as_echo "581. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:552: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:552: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:552" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:552: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:552" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:552" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:552: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:552" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:552" $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:552: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:552" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:552: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:552" ( $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:552" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:552" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:552" $as_echo "java.at:552" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:552" { set +x $as_echo "$at_srcdir/java.at:552: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:552" ( $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:552" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:553: grep -c '^ *public YYParser (Lexer yylexer) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser (Lexer yylexer) *$' YYParser.java" "java.at:553" ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:553" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %parse-param {int parse_param1} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:555: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:555" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:555" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:555: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:555" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:555" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:555: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:555" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:555" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:555: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:555" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:555" $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:555: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:555" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:555" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:555: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:555" ( $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:555" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:555" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:555" $as_echo "java.at:555" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:555" { set +x $as_echo "$at_srcdir/java.at:555: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:555" ( $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:555" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:556: 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:556" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:556" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:557: 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:557" ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:557" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:558: 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:558" ( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:558" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %parse-param {int parse_param1} %parse-param {long parse_param2} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:562: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:562" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:562: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:562" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:562" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:562: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:562" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:562" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:562: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:562" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:562" $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:562: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:562" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:562: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:562" ( $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:562" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:562" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:562" $as_echo "java.at:562" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:562" { set +x $as_echo "$at_srcdir/java.at:562: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:562" ( $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:562" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:563: 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:563" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:563" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:564: 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:564" ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:564" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:565: 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:565" ( $at_check_trace; grep -c '^ *public YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:565" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:566: 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:566" ( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:566" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:567: 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:567" ( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:567" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:569: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:569" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:569" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:569: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:569" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:569" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:569: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:569" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:569" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:569: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:569" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:569: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:569" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:569" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:569: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:569" ( $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:569" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:569" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:569" $as_echo "java.at:569" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:569" { set +x $as_echo "$at_srcdir/java.at:569: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:569" ( $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:569" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:570: grep -c '^ *public YYParser () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public YYParser () *$' YYParser.java" "java.at:570" ( $at_check_trace; grep -c '^ *public YYParser () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:570" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:571: grep -c '^ *protected YYParser (Lexer yylexer) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *protected YYParser (Lexer yylexer) *$' YYParser.java" "java.at:571" ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:571" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %parse-param {int parse_param1} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:574: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:574" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:574" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:574: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:574" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:574" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:574: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:574" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:574" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:574: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:574" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:574" $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:574: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:574" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:574" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:574: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:574" ( $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:574" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:574" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:574" $as_echo "java.at:574" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:574" { set +x $as_echo "$at_srcdir/java.at:574: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:574" ( $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:574" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:575: 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:575" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:575" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:576: 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:576" ( $at_check_trace; grep -c '^ *public YYParser (int parse_param1) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:576" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:577: 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:577" ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:577" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:578: 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:578" ( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:578" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %parse-param {int parse_param1} %parse-param {long parse_param2} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:583: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:583" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:583" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:583: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:583" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:583" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:583: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:583" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:583" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:583: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:583" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:583" $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:583: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:583" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:583" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:583: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:583" ( $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:583" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:583" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:583" $as_echo "java.at:583" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:583" { set +x $as_echo "$at_srcdir/java.at:583: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:583" ( $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:583" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:584: 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:584" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:584" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:585: 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:585" ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:585" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:586: 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:586" ( $at_check_trace; grep -c '^ *public YYParser (int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:586" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:587: 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:587" ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:587" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:588: 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:588" ( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:588" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:589: 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:589" ( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:589" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %lex-param {char lex_param1} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } YYLexer (char lex_param1) {} } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:592: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:592" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:592" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:592: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:592" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:592" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:592: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:592" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:592" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:592: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:592" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:592" $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:592: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:592" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:592" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:592: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:592" ( $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:592" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:592" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:592" $as_echo "java.at:592" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:592" { set +x $as_echo "$at_srcdir/java.at:592: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:592" ( $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:592" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:593: 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:593" ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:593" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:594: grep -c '^.* = new YYLexer *(lex_param1);\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java" "java.at:594" ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1);$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:594" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %lex-param {char lex_param1} %lex-param {short lex_param2} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } YYLexer (char lex_param1, short lex_param2) {} } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:599: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:599" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:599: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:599" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:599" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:599: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:599" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:599" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:599: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:599" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:599: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:599" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:599: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:599" ( $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:599" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:599" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:599" $as_echo "java.at:599" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:599" { set +x $as_echo "$at_srcdir/java.at:599: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:599" ( $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:599" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:600: 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:600" ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:600" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:601: 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:601" ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:601" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %parse-param {int parse_param1} %parse-param {long parse_param2} %lex-param {char lex_param1} %lex-param {short lex_param2} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } YYLexer (char lex_param1, short lex_param2) {} } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:608: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:608" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:608: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:608" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:608" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:608: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:608" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:608" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:608: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:608" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:608: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:608" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:608: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:608" ( $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:608" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:608" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:608" $as_echo "java.at:608" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:608" { set +x $as_echo "$at_srcdir/java.at:608: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:608" ( $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:608" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:609: 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:609" ( $at_check_trace; grep -c '^ *protected final int parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:609" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:610: 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:610" ( $at_check_trace; grep -c '^ *protected final long parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:610" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:611: 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:611" ( $at_check_trace; grep -c '^ *public YYParser (char lex_param1, *short lex_param2, *int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:611" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:612: 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:612" ( $at_check_trace; grep -c '^.* = new YYLexer *(lex_param1, *lex_param2);$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:612" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:613: 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:613" ( $at_check_trace; grep -c '^ *protected YYParser (Lexer yylexer, *int parse_param1, *long parse_param2) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:613" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:614: 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:614" ( $at_check_trace; grep -c '^ *this.parse_param1 = parse_param1;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:615: 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:615" ( $at_check_trace; grep -c '^ *this.parse_param2 = parse_param2;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "2 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at: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_581 #AT_START_582 at_fn_group_banner 582 'java.at:624' \ "Java throws specifications" " " 26 at_xfail=no ( $as_echo "582. $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 %define parse.error verbose %token-table %token END "end" %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException} %initial-action {if (true) throw new ClassNotFoundException();} %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException, InstantiationException} %initial-action {if (true) throw new InstantiationException();} %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define lex_throws {} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *public boolean parse () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {} %define lex_throws {} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *public boolean parse () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException} %define lex_throws {} %initial-action {if (true) throw new ClassNotFoundException();} %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException, InstantiationException} %define lex_throws {} %initial-action {if (true) throw new InstantiationException();} %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define lex_throws {InterruptedException} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {} %define lex_throws {InterruptedException} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException} %define lex_throws {InterruptedException} %initial-action {if (true) throw new ClassNotFoundException();} %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException, InstantiationException} %define lex_throws {InterruptedException} %initial-action {if (true) throw new InstantiationException();} %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define lex_throws {InterruptedException, IllegalAccessException} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {} %define lex_throws {InterruptedException, IllegalAccessException} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException} %define lex_throws {InterruptedException, IllegalAccessException} %initial-action {if (true) throw new ClassNotFoundException();} %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException, InstantiationException} %define lex_throws {InterruptedException, IllegalAccessException} %initial-action {if (true) throw new InstantiationException();} %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws java.io.IOException { throw new java.io.IOException(); } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws java.io.IOException { throw new java.io.IOException(); } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException} %initial-action {if (true) throw new ClassNotFoundException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws java.io.IOException { throw new java.io.IOException(); } } %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException, InstantiationException} %initial-action {if (true) throw new InstantiationException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws java.io.IOException { throw new java.io.IOException(); } } %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws java.io.IOException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws java.io.IOException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define lex_throws {} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *public boolean parse () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {} %define lex_throws {} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *public boolean parse () *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *public boolean parse () *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *public boolean parse () *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException} %define lex_throws {} %initial-action {if (true) throw new ClassNotFoundException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException, InstantiationException} %define lex_throws {} %initial-action {if (true) throw new InstantiationException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define lex_throws {InterruptedException} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException { throw new InterruptedException(); } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {} %define lex_throws {InterruptedException} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException { throw new InterruptedException(); } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException} %define lex_throws {InterruptedException} %initial-action {if (true) throw new ClassNotFoundException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException { throw new InterruptedException(); } } %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException, InstantiationException} %define lex_throws {InterruptedException} %initial-action {if (true) throw new InstantiationException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException { throw new InterruptedException(); } } %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *int yylex () throws InterruptedException *;\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define lex_throws {InterruptedException, IllegalAccessException} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException, IllegalAccessException { throw new IllegalAccessException(); } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {} %define lex_throws {InterruptedException, IllegalAccessException} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException, IllegalAccessException { throw new IllegalAccessException(); } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep -c '^ *private int yyaction ([^)]*) *\$' YYParser.java" at_fn_check_prepare_dynamic "grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java" "java.at:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException} %define lex_throws {InterruptedException, IllegalAccessException} %initial-action {if (true) throw new ClassNotFoundException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException, IllegalAccessException { throw new IllegalAccessException(); } } %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define throws {ClassNotFoundException, InstantiationException} %define lex_throws {InterruptedException, IllegalAccessException} %initial-action {if (true) throw new InstantiationException();} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () throws InterruptedException, IllegalAccessException { throw new IllegalAccessException(); } } %% start: END {throw new ClassNotFoundException();}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:704: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:704" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:704" $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:704: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" $as_echo "java.at:704" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:704" { set +x $as_echo "$at_srcdir/java.at:704: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:704" ( $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:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *int yylex () throws InterruptedException, IllegalAccessException *;$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *private int yyaction ([^)]*) throws ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:704: 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:704" ( $at_check_trace; grep -c '^ *public boolean parse () throws InterruptedException, IllegalAccessException, ClassNotFoundException, InstantiationException *$' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/java.at:704" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_582 #AT_START_583 at_fn_group_banner 583 'java.at:713' \ "Java constructor init and init_throws" " " 26 at_xfail=no ( $as_echo "583. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define extends {Thread} %code init { super("Test Thread"); if (true) throw new InterruptedException(); } %define init_throws {InterruptedException} %lex-param {int lex_param} %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:722: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:722" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:722" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:722: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:722" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:722" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:722: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:722" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:722" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:722: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:722" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:722" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/java.at:722: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:722" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:722" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:722: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:722" ( $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:722" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:722" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:722" $as_echo "java.at:722" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:722" { set +x $as_echo "$at_srcdir/java.at:722: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:722" ( $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:722" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:723: grep 'super(\"Test Thread\"); if (true) throw new InterruptedException();' YYParser.java" at_fn_check_prepare_trace "java.at:723" ( $at_check_trace; grep 'super("Test Thread"); if (true) throw new InterruptedException();' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:723" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define extends {Thread} %code init { super("Test Thread"); if (true) throw new InterruptedException(); } %define init_throws {InterruptedException} %code lexer { Object yylval; public Object getLVal() { return yylval; } public Position getStartPos() { return null; } public Position getEndPos() { return null; } public void yyerror (Location loc, String s) { System.err.println (loc + ": " + s); } public int yylex () { return EOF; } } %% start: END {}; %% class Position {} _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/java.at:728: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:728" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:728: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:728" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:728: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:728" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:728" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:728: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:728" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:728" $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:728: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:728" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:728" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:728: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:728" ( $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:728" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:728" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:728" $as_echo "java.at:728" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:728" { set +x $as_echo "$at_srcdir/java.at:728: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:728" ( $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:728" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:729: grep 'super(\"Test Thread\"); if (true) throw new InterruptedException();' YYParser.java" at_fn_check_prepare_trace "java.at:729" ( $at_check_trace; grep 'super("Test Thread"); if (true) throw new InterruptedException();' YYParser.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:729" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_583 #AT_START_584 at_fn_group_banner 584 'java.at:740' \ "Java value, position, and location types" " " 26 at_xfail=no ( $as_echo "584. $at_setup_line: testing $at_desc ..." $at_traceon cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define api.value.type {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:747: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:747" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:747" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:747: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:747" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:747" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:747: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:747" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:747" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:747: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:747" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:747" $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:747: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:747" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:747" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:747: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:747" ( $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:747" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:747" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:747" $as_echo "java.at:747" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:747" { set +x $as_echo "$at_srcdir/java.at:747: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:747" ( $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:747" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:748: grep 'java.awt.Color' YYParser.java" at_fn_check_prepare_trace "java.at:748" ( $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:748" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:749: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" at_fn_check_prepare_notrace 'a shell pipeline' "java.at:749" ( $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:749" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:750: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" at_fn_check_prepare_notrace 'a shell pipeline' "java.at:750" ( $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:750" $at_failed && at_fn_log_failure $at_traceon; } cat >YYParser.y <<'_ATEOF' %language "Java" %locations %debug %define parse.error verbose %token-table %token END "end" %define api.value.type {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:759: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Wno-deprecated YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:759" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Wno-deprecated 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:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:759: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated YYParser.y" "java.at:759" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated 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:759" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:759: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:759" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:759" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:759: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:759" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:759" $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:759: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated YYParser.y" at_fn_check_prepare_trace "java.at:759" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Wno-deprecated 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:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:759: grep '[mb]4_' YYParser.y" at_fn_check_prepare_trace "java.at:759" ( $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:759" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:759" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:759" $as_echo "java.at:759" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:759" { set +x $as_echo "$at_srcdir/java.at:759: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:759" ( $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:759" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:760: grep 'java.awt.Color' YYParser.java" at_fn_check_prepare_trace "java.at:760" ( $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:760" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:761: \$EGREP -v ' */?\\*' YYParser.java | grep 'Position'" at_fn_check_prepare_notrace 'a shell pipeline' "java.at:761" ( $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:761" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:762: \$EGREP -v ' */?\\*' YYParser.java | grep 'Location'" at_fn_check_prepare_notrace 'a shell pipeline' "java.at:762" ( $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:762" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_584 #AT_START_585 at_fn_group_banner 585 'java.at:771' \ "Java syntax error handling without error token" " " 26 at_xfail=no ( $as_echo "585. $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:822: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv YYParser.y" at_fn_check_prepare_notrace 'an embedded newline' "java.at:822" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv 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:822" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:822: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml YYParser.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml YYParser.y" "java.at:822" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/java.at:822" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/java.at:822: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:822" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:822" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/java.at:822: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:822" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.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/java.at:822: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret YYParser.y" at_fn_check_prepare_trace "java.at:822" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret YYParser.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/java.at:822" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "java.at:823" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/java.at:823" $as_echo "java.at:823" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/java.at:823" { set +x $as_echo "$at_srcdir/java.at:823: \$SHELL ../../../javacomp.sh YYParser.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh YYParser.java" "java.at:823" ( $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:823" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:824: \$SHELL ../../../javaexec.sh YYParser aa" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser aa" "java.at:824" ( $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:824" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:826: \$SHELL ../../../javaexec.sh YYParser ab" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ab" "java.at:826" ( $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:826" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/java.at:828: \$SHELL ../../../javaexec.sh YYParser ba" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh YYParser ba" "java.at:828" ( $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:828" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_585 #AT_START_586 at_fn_group_banner 586 'javapush.at:171' \ "Trivial Push Parser with api.push-pull verification" "" 27 at_xfail=no ( $as_echo "586. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %language "Java" %define api.parser.class {YYParser} %define parse.error verbose %define parse.trace %code imports { import java.io.*; import java.util.*; } %% start: 'a' 'b' 'c' ; %% public class Main { static class YYerror implements YYParser.Lexer { public Object getLVal() {return null;} public int yylex () throws java.io.IOException { return 0; } public void yyerror (String msg) { System.err.println(msg); } } static YYParser parser = null; static YYerror yyerror = null; static int teststate = -1; static void setup() throws IOException { yyerror = new YYerror(); parser = new YYParser(yyerror); parser.setDebugLevel(1); teststate = -1; } static String[] teststatename = new String[]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYPUSH_MORE"}; static void check(int teststate, int expected, String msg) { System.err.println("teststate="+teststatename[teststate] +"; expected="+teststatename[expected]); if (teststate != expected) { System.err.println("unexpected state: "+msg); System.exit(1); } } static public void main (String[] args) throws IOException { setup(); teststate = parser.push_parse('a', null); check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)"); setup(); teststate = parser.push_parse('a', null); check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)"); teststate = parser.push_parse('b', null); check(teststate,YYParser.YYPUSH_MORE,"push_parse('b', null)"); teststate = parser.push_parse('c', null); check(teststate,YYParser.YYPUSH_MORE,"push_parse('c', null)"); teststate = parser.push_parse('\0', null); check(teststate,YYParser.YYACCEPT,"push_parse('\\0', null)"); /* Reuse the parser instance and cause a failure */ teststate = parser.push_parse('b', null); check(teststate,YYParser.YYABORT,"push_parse('b', null)"); System.exit(0); } } _ATEOF # Verify that the proper procedure(s) are generated for each case. if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/javapush.at:180: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dapi.push-pull=pull -o Main.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:180" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dapi.push-pull=pull -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:180" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:180: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.java input.y" "javapush.at:180" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=pull -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:180" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/javapush.at:180: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:180" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:180" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/javapush.at:180: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:180" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at: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/javapush.at:180: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=pull -o Main.java input.y" at_fn_check_prepare_trace "javapush.at:180" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=pull -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:180" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:183: grep -c '^.*public boolean parse ().*\$' Main.java" at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:183" ( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:183" $at_failed && at_fn_log_failure $at_traceon; } # If BISON_USE_PUSH_FOR_PULL is set, then we have one occurrence of # this function, otherwise it should not be there. { set +x $as_echo "$at_srcdir/javapush.at:188: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java" at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:188" ( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "${BISON_USE_PUSH_FOR_PULL-0} " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:188" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/javapush.at:190: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dapi.push-pull=both -o Main.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:190" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dapi.push-pull=both -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:190" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:190: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.java input.y" "javapush.at:190" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:190" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/javapush.at:190: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:190" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:190" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/javapush.at:190: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:190" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:190" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/javapush.at:190: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=both -o Main.java input.y" at_fn_check_prepare_trace "javapush.at:190" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=both -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:190" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:193: grep -c '^.*public boolean parse ().*\$' Main.java" at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:193" ( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:193" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:196: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java" at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:196" ( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:196" $at_failed && at_fn_log_failure $at_traceon; } if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/javapush.at:198: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dapi.push-pull=push -o Main.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:198" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:198" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:198: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" "javapush.at:198" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:198" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/javapush.at:198: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:198" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:198" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/javapush.at:198: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:198" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:198" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/javapush.at:198: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=push -o Main.java input.y" at_fn_check_prepare_trace "javapush.at:198" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:198" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:201: grep -c '^.*public boolean parse ().*\$' Main.java" at_fn_check_prepare_dynamic "grep -c '^.*public boolean parse ().*$' Main.java" "javapush.at:201" ( $at_check_trace; grep -c '^.*public boolean parse ().*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "0 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:201" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:204: grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*\$' Main.java" at_fn_check_prepare_dynamic "grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java" "javapush.at:204" ( $at_check_trace; grep -c '^.*public int push_parse (int yylextoken, Object yylexval).*$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:204" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "javapush.at:206" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/javapush.at:206" $as_echo "javapush.at:206" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/javapush.at:206" { set +x $as_echo "$at_srcdir/javapush.at:206: \$SHELL ../../../javacomp.sh Main.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Main.java" "javapush.at:206" ( $at_check_trace; $SHELL ../../../javacomp.sh Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:206" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:207: \$SHELL ../../../javaexec.sh Main" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Main" "javapush.at:207" ( $at_check_trace; $SHELL ../../../javaexec.sh Main ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr captured; cp "$at_stderr" stderr at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:207" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_586 #AT_START_587 at_fn_group_banner 587 'javapush.at:216' \ "Trivial Push Parser with %initial-action" " " 27 at_xfail=no ( $as_echo "587. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %language "Java" %initial-action { System.err.println("Initial action invoked"); } %define api.parser.class {YYParser} %define parse.error verbose %define parse.trace %code imports { import java.io.*; import java.util.*; } %% start: 'a' 'b' 'c' ; %% public class Main { static class YYerror implements YYParser.Lexer { public Object getLVal() {return null;} public int yylex () throws java.io.IOException { return 0; } public void yyerror (String msg) { System.err.println(msg); } } static YYParser parser = null; static YYerror yyerror = null; static int teststate = -1; static void setup() throws IOException { yyerror = new YYerror(); parser = new YYParser(yyerror); parser.setDebugLevel(1); teststate = -1; } static String[] teststatename = new String[]{"YYACCEPT","YYABORT","YYERROR","UNKNOWN","YYPUSH_MORE"}; static void check(int teststate, int expected, String msg) { System.err.println("teststate="+teststatename[teststate] +"; expected="+teststatename[expected]); if (teststate != expected) { System.err.println("unexpected state: "+msg); System.exit(1); } } static public void main (String[] args) throws IOException { setup(); teststate = parser.push_parse('a', null); check(teststate,YYParser.YYPUSH_MORE,"push_parse('a', null)"); teststate = parser.push_parse('b', null); check(teststate,YYParser.YYPUSH_MORE,"push_parse('b', null)"); teststate = parser.push_parse('c', null); check(teststate,YYParser.YYPUSH_MORE,"push_parse('c', null)"); teststate = parser.push_parse('\0', null); check(teststate,YYParser.YYACCEPT,"push_parse('\\0', null)"); System.exit(0); } } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/javapush.at:226: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dapi.push-pull=push -o Main.java input.y" at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:226" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:226: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y" "javapush.at:226" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:226" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/javapush.at:226: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:226" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:226" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/javapush.at:226: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:226" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at: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/javapush.at:226: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=push -o Main.java input.y" at_fn_check_prepare_trace "javapush.at:226" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=push -o Main.java input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:226" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:228: grep -c '^System.err.println(\"Initial action invoked\");\$' Main.java" at_fn_check_prepare_dynamic "grep -c '^System.err.println(\"Initial action invoked\");$' Main.java" "javapush.at:228" ( $at_check_trace; grep -c '^System.err.println("Initial action invoked");$' Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:228" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "javapush.at:229" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/javapush.at:229" $as_echo "javapush.at:229" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/javapush.at:229" { set +x $as_echo "$at_srcdir/javapush.at:229: \$SHELL ../../../javacomp.sh Main.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Main.java" "javapush.at:229" ( $at_check_trace; $SHELL ../../../javacomp.sh Main.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:229" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:230: \$SHELL ../../../javaexec.sh Main" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Main" "javapush.at:230" ( $at_check_trace; $SHELL ../../../javaexec.sh Main ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr captured; cp "$at_stderr" stderr at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:230" $at_failed && at_fn_log_failure $at_traceon; } # Verify that initial action is called exactly once. { set +x $as_echo "$at_srcdir/javapush.at:235: grep -c '^Initial action invoked\$' stderr" at_fn_check_prepare_dynamic "grep -c '^Initial action invoked$' stderr" "javapush.at:235" ( $at_check_trace; grep -c '^Initial action invoked$' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:235" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_587 #AT_START_588 at_fn_group_banner 588 'javapush.at:324' \ "Calc parser with api.push-pull both" " " 27 at_xfail=no ( $as_echo "588. $at_setup_line: testing $at_desc ..." $at_traceon # Define the calculator input. # Warning: if you changes the input file # then the locations test file position numbers # may be incorrect and you will have # to modify that file as well. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF # Compose pieces to build the actual .y file. cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc */ %language "Java" %define api.parser.class {Calc} %define parse.trace %code { static class UserLexer implements Calc.Lexer { StreamTokenizer st; StringReader rdr; public UserLexer(StringReader reader) { rdr = reader; st = new StreamTokenizer(rdr); st.resetSyntax(); st.eolIsSignificant(true); st.whitespaceChars('\t', '\t'); st.whitespaceChars(' ', ' '); st.wordChars('0', '9'); } Integer yylval; public Object getLVal() { return yylval; } public void yyerror(String msg) { System.err.println(msg); } public int yylex () throws IOException { switch (st.nextToken()) { case StreamTokenizer.TT_EOF: return EOF; case StreamTokenizer.TT_EOL: return (int) '\n'; case StreamTokenizer.TT_WORD: yylval = new Integer (st.sval); return NUM; default: return st.ttype; } } } } %code { public static void main (String[] args) throws IOException { StringReader reader = getinput(args[0]); UserLexer lexer = new UserLexer(reader); Calc calc = new Calc(lexer); calc.setDebugLevel(1); calc.parse(); }//main } %code imports { import java.io.*; } %code { static StringReader getinput(String filename) throws IOException { // Yes, there are better alternatives to StringBuffer. But we // don't really care about performances here, while portability // to older Java matters. StringBuffer buf = new StringBuffer(); FileReader file = new FileReader(filename); int c; while (0 < (c = file.read())) buf.append((char)c); file.close(); return new StringReader(buf.toString()); } } /* 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' { System.out.println("total = "+$1); } | error '\n' ; exp: NUM { $$ = $1;} | exp '=' exp { if ($1.intValue() != $3.intValue()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int)Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2;} | '(' error ')' { $$ = new Integer (1111);} | '!' { $$ = new Integer (0); return YYERROR;} | '-' error { $$ = new Integer (0); return YYERROR;} ; _ATEOF # This data was captured from running a pull parser. cat >expout <<'_ATEOF' Stack now 0 Stack now 0 2 Stack now 0 9 Stack now 0 9 19 Stack now 0 9 19 2 Stack now 0 9 19 28 Stack now 0 9 19 28 20 Stack now 0 9 19 28 20 2 Stack now 0 9 19 28 20 29 Stack now 0 9 19 28 Stack now 0 9 Stack now 0 9 17 Stack now 0 9 17 2 Stack now 0 9 17 26 Stack now 0 9 Stack now 0 9 23 Stack now 0 8 Stack now 0 7 Stack now 0 7 2 Stack now 0 7 9 Stack now 0 7 9 19 Stack now 0 7 9 19 2 Stack now 0 7 9 19 28 Stack now 0 7 9 19 28 20 Stack now 0 7 9 19 28 20 3 Stack now 0 7 9 19 28 20 3 2 Stack now 0 7 9 19 28 20 3 12 Stack now 0 7 9 19 28 20 29 Stack now 0 7 9 19 28 Stack now 0 7 9 Stack now 0 7 9 17 Stack now 0 7 9 17 3 Stack now 0 7 9 17 3 2 Stack now 0 7 9 17 3 12 Stack now 0 7 9 17 26 Stack now 0 7 9 Stack now 0 7 9 23 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 4 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 3 Stack now 0 7 3 2 Stack now 0 7 3 12 Stack now 0 7 3 12 22 Stack now 0 7 3 12 22 2 Stack now 0 7 3 12 22 31 Stack now 0 7 3 12 Stack now 0 7 9 Stack now 0 7 9 17 Stack now 0 7 9 17 3 Stack now 0 7 9 17 3 2 Stack now 0 7 9 17 3 12 Stack now 0 7 9 17 26 Stack now 0 7 9 Stack now 0 7 9 23 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 5 Stack now 0 7 5 3 Stack now 0 7 5 3 2 Stack now 0 7 5 3 12 Stack now 0 7 5 14 Stack now 0 7 5 14 25 Stack now 0 7 9 Stack now 0 7 9 22 Stack now 0 7 9 22 2 Stack now 0 7 9 22 31 Stack now 0 7 9 Stack now 0 7 9 17 Stack now 0 7 9 17 2 Stack now 0 7 9 17 26 Stack now 0 7 9 Stack now 0 7 9 23 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 4 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 3 Stack now 0 7 3 3 Stack now 0 7 3 3 3 Stack now 0 7 3 3 3 2 Stack now 0 7 3 3 3 12 Stack now 0 7 3 3 12 Stack now 0 7 3 12 Stack now 0 7 9 Stack now 0 7 9 17 Stack now 0 7 9 17 3 Stack now 0 7 9 17 3 2 Stack now 0 7 9 17 3 12 Stack now 0 7 9 17 26 Stack now 0 7 9 Stack now 0 7 9 23 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 4 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 2 Stack now 0 7 9 Stack now 0 7 9 18 Stack now 0 7 9 18 2 Stack now 0 7 9 18 27 Stack now 0 7 9 Stack now 0 7 9 18 Stack now 0 7 9 18 2 Stack now 0 7 9 18 27 Stack now 0 7 9 Stack now 0 7 9 17 Stack now 0 7 9 17 3 Stack now 0 7 9 17 3 2 Stack now 0 7 9 17 3 12 Stack now 0 7 9 17 26 Stack now 0 7 9 Stack now 0 7 9 23 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 2 Stack now 0 7 9 Stack now 0 7 9 18 Stack now 0 7 9 18 5 Stack now 0 7 9 18 5 2 Stack now 0 7 9 18 5 14 Stack now 0 7 9 18 5 14 18 Stack now 0 7 9 18 5 14 18 2 Stack now 0 7 9 18 5 14 18 27 Stack now 0 7 9 18 5 14 Stack now 0 7 9 18 5 14 25 Stack now 0 7 9 18 27 Stack now 0 7 9 Stack now 0 7 9 17 Stack now 0 7 9 17 2 Stack now 0 7 9 17 26 Stack now 0 7 9 Stack now 0 7 9 23 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 4 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 2 Stack now 0 7 9 Stack now 0 7 9 22 Stack now 0 7 9 22 2 Stack now 0 7 9 22 31 Stack now 0 7 9 22 31 22 Stack now 0 7 9 22 31 22 2 Stack now 0 7 9 22 31 22 31 Stack now 0 7 9 22 31 Stack now 0 7 9 Stack now 0 7 9 17 Stack now 0 7 9 17 2 Stack now 0 7 9 17 26 Stack now 0 7 9 Stack now 0 7 9 23 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 5 Stack now 0 7 5 2 Stack now 0 7 5 14 Stack now 0 7 5 14 22 Stack now 0 7 5 14 22 2 Stack now 0 7 5 14 22 31 Stack now 0 7 5 14 Stack now 0 7 5 14 25 Stack now 0 7 9 Stack now 0 7 9 22 Stack now 0 7 9 22 2 Stack now 0 7 9 22 31 Stack now 0 7 9 Stack now 0 7 9 17 Stack now 0 7 9 17 2 Stack now 0 7 9 17 26 Stack now 0 7 9 Stack now 0 7 9 23 Stack now 0 7 16 Stack now 0 7 Stack now 0 7 15 _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/javapush.at:593: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dapi.push-pull=both -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:593" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:593" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:593: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" "javapush.at:593" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:593" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/javapush.at:593: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:593" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:593" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/javapush.at:593: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:593" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:593" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/javapush.at:593: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y" at_fn_check_prepare_trace "javapush.at:593" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:593" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "javapush.at:595" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/javapush.at:595" $as_echo "javapush.at:595" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/javapush.at:595" { set +x $as_echo "$at_srcdir/javapush.at:595: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "javapush.at:595" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:595" $at_failed && at_fn_log_failure $at_traceon; } # Verify that this is a push parser. { set +x $as_echo "$at_srcdir/javapush.at:598: grep -c '^.*public void push_parse_initialize().*\$' Calc.java" at_fn_check_prepare_dynamic "grep -c '^.*public void push_parse_initialize().*$' Calc.java" "javapush.at:598" ( $at_check_trace; grep -c '^.*public void push_parse_initialize().*$' Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:598" $at_failed && at_fn_log_failure $at_traceon; } # Capture stderr output for comparison purposes. { set +x $as_echo "$at_srcdir/javapush.at:600: \$SHELL ../../../javaexec.sh Calc input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc input" "javapush.at:600" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr captured; cp "$at_stderr" stderr at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:600" $at_failed && at_fn_log_failure $at_traceon; } # Extract the "Stack Now" lines from the error output, # send them to stdout (via the sed command) and compare to expout. # NOTE: because the target is "expout", this macro automatically # compares the output of the sed command with the contents of # the file "expout" (defined above). { set +x $as_echo "$at_srcdir/javapush.at:607: sed -e '/^Stack now.*\$/p' -e d ./stderr" at_fn_check_prepare_dynamic "sed -e '/^Stack now.*$/p' -e d ./stderr" "javapush.at:607" ( $at_check_trace; sed -e '/^Stack now.*$/p' -e d ./stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff expout "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at: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_588 #AT_START_589 at_fn_group_banner 589 'javapush.at:621' \ "Calc parser with %locations %code lexer and api.push-pull both" "" 27 at_xfail=no ( $as_echo "589. $at_setup_line: testing $at_desc ..." $at_traceon cat >Calc.y <<'_ATEOF' /* Infix notation calculator--calc. */ %language "Java" %define api.parser.class {Calc} %define parse.trace %lex-param { Reader rdr } %locations %code imports { import java.io.*; } %code lexer { StreamTokenizer st; Integer yylval; public YYLexer(Reader rdr) { st = new StreamTokenizer(rdr); st.resetSyntax(); st.eolIsSignificant(true); st.whitespaceChars('\t', '\t'); st.whitespaceChars(' ', ' '); st.wordChars('0', '9'); } Position yypos = new Position (1, 0); public Position getStartPos() { return yypos; } public Position getEndPos() { return yypos; } public Object getLVal() { return yylval; } public void yyerror(Location loc, String msg) { System.err.println(loc+":"+msg); } public int yylex () throws IOException { yypos = new Position (yypos.lineno (),yypos.token () + 1); switch (st.nextToken()) { case StreamTokenizer.TT_EOF: return EOF; case StreamTokenizer.TT_EOL: yypos = new Position (yypos.lineno () + 1, 0); return (int) '\n'; case StreamTokenizer.TT_WORD: yylval = new Integer (st.sval); return NUM; default: return st.ttype; } } } %code { class Position { public int line; public int token; public Position () { line = 0; token = 0; } public Position (int l, int t) { line = l; token = t; } public boolean equals (Position l) { return l.line == line && l.token == token; } public String toString () { return Integer.toString (line) + "." + Integer.toString(token); } public int lineno () { return line; } public int token () { return token; } } } %code { public static void main (String[] args) throws IOException { StringReader reader = getinput(args[0]); Calc calc = new Calc(reader); calc.setDebugLevel(1); calc.parse(); } } %code imports { import java.io.*; } %code { static StringReader getinput(String filename) throws IOException { // Yes, there are better alternatives to StringBuffer. But we // don't really care about performances here, while portability // to older Java matters. StringBuffer buf = new StringBuffer(); FileReader file = new FileReader(filename); int c; while (0 < (c = file.read())) buf.append((char)c); file.close(); return new StringReader(buf.toString()); } } /* 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' { System.out.println("total = "+$1); } | error '\n' ; exp: NUM { $$ = $1;} | exp '=' exp { if ($1.intValue() != $3.intValue()) yyerror ( "calc: error: " + $1 + " != " + $3); } | exp '+' exp { $$ = new Integer ($1.intValue () + $3.intValue ()); } | exp '-' exp { $$ = new Integer ($1.intValue () - $3.intValue ()); } | exp '*' exp { $$ = new Integer ($1.intValue () * $3.intValue ()); } | exp '/' exp { $$ = new Integer ($1.intValue () / $3.intValue ()); } | '-' exp %prec NEG { $$ = new Integer (-$2.intValue ()); } | exp '^' exp { $$ = new Integer ((int)Math.pow ($1.intValue (), $3.intValue ())); } | '(' exp ')' { $$ = $2;} | '(' error ')' { $$ = new Integer (1111);} | '!' { $$ = new Integer (0); return YYERROR;} | '-' error { $$ = new Integer (0); return YYERROR;} ; _ATEOF # Define the expected calculator output. # This should match the output from a pull parser. cat >output <<'_ATEOF' total = 7 total = -5 total = -1 total = 1 total = -1 total = -4 total = 2 total = 256 total = 64 _ATEOF cat >locations <<'_ATEOF' Next token is token "number" (1.1: 1) Next token is token '+' (1.2: 1) Next token is token "number" (1.3: 2) Next token is token '*' (1.4: 2) Next token is token "number" (1.5: 3) Next token is token '=' (1.6: 3) Next token is token '=' (1.6: 3) Next token is token '=' (1.6: 3) Next token is token "number" (1.7: 7) Next token is token '\n' (2.0: 7) Next token is token '\n' (2.0: 7) Next token is token "number" (2.1: 1) Next token is token '+' (2.2: 1) Next token is token "number" (2.3: 2) Next token is token '*' (2.4: 2) Next token is token '-' (2.5: 2) Next token is token "number" (2.6: 3) Next token is token '=' (2.7: 3) Next token is token '=' (2.7: 3) Next token is token '=' (2.7: 3) Next token is token '=' (2.7: 3) Next token is token '-' (2.8: 3) Next token is token "number" (2.9: 5) Next token is token '\n' (3.0: 5) Next token is token '\n' (3.0: 5) Next token is token '\n' (3.0: 5) Next token is token '\n' (4.0: 5) Next token is token '-' (4.1: 5) Next token is token "number" (4.2: 1) Next token is token '^' (4.3: 1) Next token is token "number" (4.4: 2) Next token is token '=' (4.5: 2) Next token is token '=' (4.5: 2) Next token is token '=' (4.5: 2) Next token is token '-' (4.6: 2) Next token is token "number" (4.7: 1) Next token is token '\n' (5.0: 1) Next token is token '\n' (5.0: 1) Next token is token '\n' (5.0: 1) Next token is token '(' (5.1: 1) Next token is token '-' (5.2: 1) Next token is token "number" (5.3: 1) Next token is token ')' (5.4: 1) Next token is token ')' (5.4: 1) Next token is token '^' (5.5: 1) Next token is token "number" (5.6: 2) Next token is token '=' (5.7: 2) Next token is token '=' (5.7: 2) Next token is token "number" (5.8: 1) Next token is token '\n' (6.0: 1) Next token is token '\n' (6.0: 1) Next token is token '\n' (7.0: 1) Next token is token '-' (7.1: 1) Next token is token '-' (7.2: 1) Next token is token '-' (7.3: 1) Next token is token "number" (7.4: 1) Next token is token '=' (7.5: 1) Next token is token '=' (7.5: 1) Next token is token '=' (7.5: 1) Next token is token '=' (7.5: 1) Next token is token '-' (7.6: 1) Next token is token "number" (7.7: 1) Next token is token '\n' (8.0: 1) Next token is token '\n' (8.0: 1) Next token is token '\n' (8.0: 1) Next token is token '\n' (9.0: 1) Next token is token "number" (9.1: 1) Next token is token '-' (9.2: 1) Next token is token "number" (9.3: 2) Next token is token '-' (9.4: 2) Next token is token '-' (9.4: 2) Next token is token "number" (9.5: 3) Next token is token '=' (9.6: 3) Next token is token '=' (9.6: 3) Next token is token '-' (9.7: 3) Next token is token "number" (9.8: 4) Next token is token '\n' (10.0: 4) Next token is token '\n' (10.0: 4) Next token is token '\n' (10.0: 4) Next token is token "number" (10.1: 1) Next token is token '-' (10.2: 1) Next token is token '(' (10.3: 1) Next token is token "number" (10.4: 2) Next token is token '-' (10.5: 2) Next token is token "number" (10.6: 3) Next token is token ')' (10.7: 3) Next token is token ')' (10.7: 3) Next token is token '=' (10.8: 3) Next token is token '=' (10.8: 3) Next token is token "number" (10.9: 2) Next token is token '\n' (11.0: 2) Next token is token '\n' (11.0: 2) Next token is token '\n' (12.0: 2) Next token is token "number" (12.1: 2) Next token is token '^' (12.2: 2) Next token is token "number" (12.3: 2) Next token is token '^' (12.4: 2) Next token is token "number" (12.5: 3) Next token is token '=' (12.6: 3) Next token is token '=' (12.6: 3) Next token is token '=' (12.6: 3) Next token is token "number" (12.7: 256) Next token is token '\n' (13.0: 256) Next token is token '\n' (13.0: 256) Next token is token '(' (13.1: 256) Next token is token "number" (13.2: 2) Next token is token '^' (13.3: 2) Next token is token "number" (13.4: 2) Next token is token ')' (13.5: 2) Next token is token ')' (13.5: 2) Next token is token '^' (13.6: 2) Next token is token "number" (13.7: 3) Next token is token '=' (13.8: 3) Next token is token '=' (13.8: 3) Next token is token "number" (13.9: 64) Next token is token '\n' (14.0: 64) Next token is token '\n' (14.0: 64) Next token is token $end (14.1: 64) _ATEOF # Define the calculator input. # Warning: if you changes the input file # then the locations test file position numbers # may be incorrect and you will have # to modify that file as well. cat >input <<'_ATEOF' 1 + 2 * 3 = 7 1 + 2 * -3 = -5 -1^2 = -1 (-1)^2 = 1 ---1 = -1 1 - 2 - 3 = -4 1 - (2 - 3) = 2 2^2^3 = 256 (2^2)^3 = 64 _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/javapush.at:854: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -Dapi.push-pull=both -o Calc.java Calc.y" at_fn_check_prepare_notrace 'an embedded newline' "javapush.at:854" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:854" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:854: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y" "javapush.at:854" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:854" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/javapush.at:854: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\ xml-tests/test.xml" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:854" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:854" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/javapush.at:854: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\ xml-tests/test.xml | sort" at_fn_check_prepare_notrace 'a `...` command substitution' "javapush.at:854" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:854" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/javapush.at:854: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y" at_fn_check_prepare_trace "javapush.at:854" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -Dapi.push-pull=both -o Calc.java Calc.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:854" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "javapush.at:855" >"$at_check_line_file" (test -z "$CONF_JAVAC") \ && at_fn_check_skip 77 "$at_srcdir/javapush.at:855" $as_echo "javapush.at:855" >"$at_check_line_file" (test -z "$CONF_JAVA") \ && at_fn_check_skip 77 "$at_srcdir/javapush.at:855" { set +x $as_echo "$at_srcdir/javapush.at:855: \$SHELL ../../../javacomp.sh Calc.java" at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh Calc.java" "javapush.at:855" ( $at_check_trace; $SHELL ../../../javacomp.sh Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:855" $at_failed && at_fn_log_failure $at_traceon; } # Verify that this is a push parser { set +x $as_echo "$at_srcdir/javapush.at:858: grep -c '^.*public void push_parse_initialize().*\$' Calc.java" at_fn_check_prepare_dynamic "grep -c '^.*public void push_parse_initialize().*$' Calc.java" "javapush.at:858" ( $at_check_trace; grep -c '^.*public void push_parse_initialize().*$' Calc.java ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: echo >>"$at_stdout"; $as_echo "1 " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:858" $at_failed && at_fn_log_failure $at_traceon; } # Capture the stdout and stderr output for comparison purposes. { set +x $as_echo "$at_srcdir/javapush.at:860: \$SHELL ../../../javaexec.sh Calc input" at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh Calc input" "javapush.at:860" ( $at_check_trace; $SHELL ../../../javaexec.sh Calc input ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr captured; cp "$at_stderr" stderr echo stdout captured; cp "$at_stdout" stdout at_fn_check_status 0 $at_status "$at_srcdir/javapush.at:860" $at_failed && at_fn_log_failure $at_traceon; } # 1. Check that the token locations are correct { set +x $as_echo "$at_srcdir/javapush.at:862: cp -f ./locations ./expout" at_fn_check_prepare_trace "javapush.at:862" ( $at_check_trace; cp -f ./locations ./expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_check_skip $at_status "$at_srcdir/javapush.at:862" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:863: sed -e '/^Next token.*\$/p' -e d ./stderr" at_fn_check_prepare_dynamic "sed -e '/^Next token.*$/p' -e d ./stderr" "javapush.at:863" ( $at_check_trace; sed -e '/^Next token.*$/p' -e d ./stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff expout "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:863" $at_failed && at_fn_log_failure $at_traceon; } # 2. Check that the calculator output matches that of a pull parser { set +x $as_echo "$at_srcdir/javapush.at:865: rm -f ./expout; cp -f ./output ./expout" at_fn_check_prepare_trace "javapush.at:865" ( $at_check_trace; rm -f ./expout; cp -f ./output ./expout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_check_skip $at_status "$at_srcdir/javapush.at:865" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/javapush.at:866: cat ./stdout" at_fn_check_prepare_trace "javapush.at:866" ( $at_check_trace; cat ./stdout ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff expout "$at_stdout" || at_failed=: at_fn_check_skip $at_status "$at_srcdir/javapush.at:866" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_589 #AT_START_590 at_fn_group_banner 590 'cxx-type.at:390' \ "GLR: Resolve ambiguity, impure, no locations" " " 28 at_xfail=no ( $as_echo "590. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include 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_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } _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:392: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:392" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:392" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:392: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:392" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:392" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:392: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:392" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:392" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:392: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:392" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:392" $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:392: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:392" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:392" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:392" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:392" { set +x $as_echo "$at_srcdir/cxx-type.at:392: \$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:392" ( $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:392" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:394: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:394" ( $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:394" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:394" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:394" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_590 #AT_START_591 at_fn_group_banner 591 'cxx-type.at:397' \ "GLR: Resolve ambiguity, impure, locations" " " 28 at_xfail=no ( $as_echo "591. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; printf ("%d.%d-%d.%d: ", @2.first_line, @2.first_column, @2.last_line, @2.last_column); output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } yylloc.last_column = colNum-1; return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } _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:398: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:398" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:398" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:398: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:398" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:398" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:398: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:398" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:398" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:398: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:398" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:398" $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:398: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:398" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:398" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:398" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:398" { set +x $as_echo "$at_srcdir/cxx-type.at:398: \$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:398" ( $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:398" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:400: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:400" ( $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:400" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:400" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:400" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_591 #AT_START_592 at_fn_group_banner 592 'cxx-type.at:403' \ "GLR: Resolve ambiguity, pure, no locations" " " 28 at_xfail=no ( $as_echo "592. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include 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_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } _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:405: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:405" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:405" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:405: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:405" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:405" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:405: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:405" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:405" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:405: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:405" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/cxx-type.at:405: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:405" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:405" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:405" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:405" { set +x $as_echo "$at_srcdir/cxx-type.at:405: \$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:405" ( $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:405" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:407: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:407" ( $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:407" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:407" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:407" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_592 #AT_START_593 at_fn_group_banner 593 'cxx-type.at:410' \ "GLR: Resolve ambiguity, pure, locations" " " 28 at_xfail=no ( $as_echo "593. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; printf ("%d.%d-%d.%d: ", @2.first_line, @2.first_column, @2.last_line, @2.last_column); output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %dprec 1 { $$ = $1; } | decl %dprec 2 | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } yylloc.last_column = colNum-1; return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } _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:412: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:412" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:412" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:412: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:412" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:412" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:412: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:412" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:412" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:412: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:412" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:412" $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:412: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:412" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:412" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:412" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:412" { set +x $as_echo "$at_srcdir/cxx-type.at:412: \$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:412" ( $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:412" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:414: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:414" ( $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:414" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:414" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:414" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_593 #AT_START_594 at_fn_group_banner 594 'cxx-type.at:417' \ "GLR: Merge conflicting parses, impure, no locations" "" 28 at_xfail=no ( $as_echo "594. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include 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_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:419: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:419" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:419" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:419: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:419" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:419" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:419: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:419" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:419" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:419: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:419" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:419" $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:419: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:419" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:419" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:419" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:419" { set +x $as_echo "$at_srcdir/cxx-type.at:419: \$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:419" ( $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:419" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:421: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:421" ( $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:421" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:421: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.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 " | \ $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:421" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_594 #AT_START_595 at_fn_group_banner 595 'cxx-type.at:424' \ "GLR: Merge conflicting parses, impure, locations" "" 28 at_xfail=no ( $as_echo "595. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (const char *msg); static int yylex (void); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; printf ("%d.%d-%d.%d: ", @2.first_line, @2.first_column, @2.last_line, @2.last_column); output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %merge { $$ = $1; } | decl %merge | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (const char *msg) { LOCATION_PRINT (stderr, (yylloc)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (void) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } yylloc.last_column = colNum-1; return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:426: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:426" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:426" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:426: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:426" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:426" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:426: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:426" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:426" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:426: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:426" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/cxx-type.at:426: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:426" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:426" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:426" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:426" { set +x $as_echo "$at_srcdir/cxx-type.at:426: \$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:426" ( $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:426" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:428: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:428" ( $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:428" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:428: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:428" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:428" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_595 #AT_START_596 at_fn_group_banner 596 'cxx-type.at:431' \ "GLR: Merge conflicting parses, pure, no locations" "" 28 at_xfail=no ( $as_echo "596. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include 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_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:433: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:433" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:433" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:433: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:433" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:433" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:433: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:433" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:433" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:433: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:433" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:433" $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:433: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:433" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:433" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:433" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:433" { set +x $as_echo "$at_srcdir/cxx-type.at:433: \$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:433" ( $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:433" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:435: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:435" ( $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:435" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:435: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:435" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:435" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_596 #AT_START_597 at_fn_group_banner 597 'cxx-type.at:437' \ "GLR: Merge conflicting parses, pure, locations" " " 28 at_xfail=no ( $as_echo "597. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); } %token TYPENAME ID %right '=' %left '+' %glr-parser %destructor { free_node ($$); } stmt expr decl declarator TYPENAME ID %% prog : | prog stmt { char *output; printf ("%d.%d-%d.%d: ", @2.first_line, @2.first_column, @2.last_line, @2.last_column); output = node_to_string ($2); printf ("%s\n", output); free (output); free_node ($2); } ; stmt : expr ';' %merge { $$ = $1; } | decl %merge | error ';' { $$ = new_nterm ("", YY_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } yylloc.last_column = colNum-1; return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:439: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:439" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:439" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:439: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:439" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:439" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:439: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:439" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:439" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:439: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:439" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:439" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/cxx-type.at:439: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:439" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:439" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:439" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:439" { set +x $as_echo "$at_srcdir/cxx-type.at:439: \$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:439" ( $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:439" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:441: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:441" ( $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:441" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:441: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:441" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:441" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_597 #AT_START_598 at_fn_group_banner 598 'cxx-type.at:444' \ "GLR: Verbose messages, resolve ambiguity, impure, no locations" "" 28 at_xfail=no ( $as_echo "598. $at_setup_line: testing $at_desc ..." $at_traceon cat >types.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Simplified C++ Type and Expression Grammar. */ %define parse.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 #include 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_NULLPTR, YY_NULLPTR, YY_NULLPTR); } | '@' { YYACCEPT; } ; expr : ID | TYPENAME '(' expr ')' { $$ = new_nterm ("(%s,%s)", $3, $1, YY_NULLPTR); } | expr '+' expr { $$ = new_nterm ("+(%s,%s)", $1, $3, YY_NULLPTR); } | expr '=' expr { $$ = new_nterm ("=(%s,%s)", $1, $3, YY_NULLPTR); } ; decl : TYPENAME declarator ';' { $$ = new_nterm ("(%s,%s)", $1, $2, YY_NULLPTR); } | 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); (void) argc; if (!freopen (argv[1], "r", stdin)) return 3; return yyparse (); } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { static int lineNum = 1; static int colNum = 0; #if YYPURE # undef yylloc # define yylloc (*llocp) # undef yylval # define yylval (*lvalp) #endif while (1) { int c; 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)) { char buffer[256]; unsigned i = 0; do { buffer[i++] = YY_CAST (char, c); colNum += 1; assert (i != sizeof buffer - 1); c = getchar (); } while (isalnum (c) || c == '_'); ungetc (c, stdin); buffer[i++] = 0; tok = isupper (YY_CAST (unsigned char, buffer[0])) ? TYPENAME : ID; yylval = new_term (strcpy (YY_CAST (char *, malloc (i)), buffer)); } else { colNum += 1; tok = c; yylval = YY_NULLPTR; } return tok; } } } } static Node * new_nterm (char const *form, Node *child0, Node *child1, Node *child2) { Node *node = YY_CAST (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 = YY_CAST (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 *res; if (!node) { res = YY_CAST (char *, malloc (1)); res[0] = 0; } else if (node->nodeInfo.isNterm == 1) { char *child0 = node_to_string (node->nterm.children[0]); char *child1 = node_to_string (node->nterm.children[1]); char *child2 = node_to_string (node->nterm.children[2]); res = YY_CAST (char *, malloc (strlen (node->nterm.form) + strlen (child0) + strlen (child1) + strlen (child2) + 1)); sprintf (res, node->nterm.form, child0, child1, child2); free (child2); free (child1); free (child0); } else res = strdup (node->term.text); return res; } static YYSTYPE stmtMerge (YYSTYPE x0, YYSTYPE x1) { return new_nterm ("(%s,%s)", x0, x1, YY_NULLPTR); } _ATEOF cat >test-input <<'_ATEOF' z + q; T x; T x = y; x = y; T (x) + y; T (x); T (y) = z + q; T (y y) = z + q; z + q; @ This is total garbage, but it should be ignored. _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/cxx-type.at:446: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o types.c types.y" at_fn_check_prepare_notrace 'an embedded newline' "cxx-type.at:446" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -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:446" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:446: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y" "cxx-type.at:446" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:446" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/cxx-type.at:446: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:446" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:446" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/cxx-type.at:446: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:446" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:446" $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:446: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y" at_fn_check_prepare_trace "cxx-type.at:446" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o types.c types.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/cxx-type.at:446" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "cxx-type.at:446" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/cxx-type.at:446" { set +x $as_echo "$at_srcdir/cxx-type.at:446: \$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:446" ( $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:446" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:448: \$PREPARSER ./types test-input" at_fn_check_prepare_dynamic " $PREPARSER ./types test-input" "cxx-type.at:448" ( $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:448" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/cxx-type.at:448: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "cxx-type.at:448" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:448" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_598 #AT_START_599 at_fn_group_banner 599 'glr-regression.at:25' \ "Badly Collapsed GLR States" " " 29 at_xfail=no ( $as_echo "599. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr1.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Regression Test: Improper state compression */ /* Reported by Scott McPeak */ %{ #include #include #include #define YYSTYPE int static YYSTYPE exprMerge (YYSTYPE x0, YYSTYPE x1); #include static void yyerror (const char *msg); static int yylex (void); %} %define parse.assert %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_NULLPTR; int main (int argc, const char* argv[]) { assert (argc == 2); (void) argc; input = argv[1]; return yyparse (); } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { return *input++; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:92: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr1.c -rall glr-regr1.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr1.c -rall 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:92" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:92: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c -rall glr-regr1.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c -rall glr-regr1.y" "glr-regression.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr1.c -rall 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:92" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:92: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:92" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:92" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:92: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:92" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:92" $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:92: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y" at_fn_check_prepare_trace "glr-regression.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr1.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:92: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y -Werror" "glr-regression.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr1.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:92: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:92" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:92: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y --warnings=error" "glr-regression.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:92" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:92: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y -Wnone,none -Werror --trace=none" "glr-regression.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:92" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:92: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y --warnings=none -Werror --trace=none" "glr-regression.at:92" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr1.c -rall glr-regr1.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:92" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:93" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:93" { 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:104: \$PREPARSER ./glr-regr1 BPBPB" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr1 BPBPB" "glr-regression.at:104" ( $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:104" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:104: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:104" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:104" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_599 #AT_START_600 at_fn_group_banner 600 'glr-regression.at:112' \ "Improper handling of embedded actions and dollar(-N) in GLR parsers" "" 29 at_xfail=no ( $as_echo "600. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr2a.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Regression Test: Improper handling of embedded actions and $-N */ /* Reported by S. Eken */ %{ #define YYSTYPE char * #include #include #include #include #include #include static void yyerror (const char *msg); static int yylex (void); %} %define parse.assert %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 = YY_CAST (char *, realloc ($1, strlen ($1) + 1 + strlen ($3) + 1)); strcat (s, ","); strcat (s, $3); free ($3); $$ = s; } ; var_printer: 'v' { printf ("Variable: '%s'\n", $-1); } %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } FILE *input; int yylex (void) { char buf[50]; assert (!feof (stdin)); switch (fscanf (input, " %1[a-z,]", buf)) { case 1: return buf[0]; case EOF: return 0; default: if (fscanf (input, "%49s", buf) != 1) return 0; else { char *s; assert (strlen (buf) < sizeof buf - 1); s = YY_CAST (char *, malloc (strlen (buf) + 1)); strcpy (s, buf); yylval = s; return 'V'; } break; } } 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:216: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr2a.c -rall glr-regr2a.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:216" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr2a.c -rall 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:216" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:216: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c -rall glr-regr2a.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c -rall glr-regr2a.y" "glr-regression.at:216" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr2a.c -rall 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:216" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:216: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:216" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:216" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:216: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:216" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:216" $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:216: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y" at_fn_check_prepare_trace "glr-regression.at:216" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr2a.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:216" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:216: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y -Werror" "glr-regression.at:216" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:216" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr2a.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:216: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:216" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:216" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:216: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y --warnings=error" "glr-regression.at:216" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:216" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:216: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y -Wnone,none -Werror --trace=none" "glr-regression.at:216" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:216" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:216: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y --warnings=none -Werror --trace=none" "glr-regression.at:216" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr2a.c -rall glr-regr2a.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:216" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:217" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:217" { set +x $as_echo "$at_srcdir/glr-regression.at:217: \$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:217" ( $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:217" $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:224: \$PREPARSER ./glr-regr2a input1.txt" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input1.txt" "glr-regression.at:224" ( $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:224" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:224: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:224" ( $at_check_trace; 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:224" $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:232: \$PREPARSER ./glr-regr2a input2.txt" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input2.txt" "glr-regression.at:232" ( $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:232" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:232: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:232" ( $at_check_trace; 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:232" $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:239: \$PREPARSER ./glr-regr2a input3.txt" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr2a input3.txt" "glr-regression.at:239" ( $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:239" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:239: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:239" ( $at_check_trace; 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:239" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_600 #AT_START_601 at_fn_group_banner 601 'glr-regression.at:248' \ "Improper merging of GLR delayed action sets" " " 29 at_xfail=no ( $as_echo "601. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr3.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* Regression Test: Improper merging of GLR delayed action sets. */ /* Reported by M. Rosien */ %{ #include #include #include #include static int MergeRule (int x0, int x1); #include static void yyerror (const char *msg); static int yylex (void); #define RULE(x) (1 << (x)) %} %define parse.assert %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; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } FILE *input = YY_NULLPTR; int P[] = { P1, P2 }; int O[] = { O1, O2 }; int T[] = { T1, T2, T3, T4 }; int yylex (void) { char inp[3]; assert (!feof (stdin)); if (fscanf (input, "%2s", inp) == EOF) return 0; switch (inp[0]) { case 'p': return P[inp[1] - '1']; case 't': return T[inp[1] - '1']; case 'o': return O[inp[1] - '1']; } return BAD_CHAR; } int main (int argc, char* argv[]) { int res; input = stdin; if (argc == 2 && !(input = fopen (argv[1], "r"))) return 3; res = yyparse (); if (argc == 2 && fclose (input)) return 4; return res; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr3.c -rall glr-regr3.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr3.c -rall 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:351" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c -rall glr-regr3.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c -rall glr-regr3.y" "glr-regression.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr3.c -rall 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:351" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:351" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:351: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:351" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:351" $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:351: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y" at_fn_check_prepare_trace "glr-regression.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] glr-regr3.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:351" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y -Werror" "glr-regression.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:351" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr3.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] glr-regr3.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:351: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:351" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:351" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y --warnings=error" "glr-regression.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:351" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y -Wnone,none -Werror --trace=none" "glr-regression.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:351" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:351: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y --warnings=none -Werror --trace=none" "glr-regression.at:351" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr3.c -rall glr-regr3.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:351" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:352" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:352" { set +x $as_echo "$at_srcdir/glr-regression.at:352: \$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:352" ( $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:352" $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:360: \$PREPARSER ./glr-regr3 input.txt" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr3 input.txt" "glr-regression.at:360" ( $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:360" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:360" ( $at_check_trace; 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: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_601 #AT_START_602 at_fn_group_banner 602 'glr-regression.at:370' \ "Duplicate representation of merged trees" " " 29 at_xfail=no ( $as_echo "602. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr4.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.assert %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 *); #include 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'"); } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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++ = YY_CAST (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++ = YY_CAST (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:447: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr4.c -rall glr-regr4.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr4.c -rall 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:447" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:447: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c -rall glr-regr4.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c -rall glr-regr4.y" "glr-regression.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr4.c -rall 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:447" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:447: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:447" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:447" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:447: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:447" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:447" $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:447: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y" at_fn_check_prepare_trace "glr-regression.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr4.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:447" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:447: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y -Werror" "glr-regression.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:447" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr4.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:447: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:447" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:447" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:447: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y --warnings=error" "glr-regression.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:447" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:447: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y -Wnone,none -Werror --trace=none" "glr-regression.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:447" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:447: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y --warnings=none -Werror --trace=none" "glr-regression.at:447" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr4.c -rall glr-regr4.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:447" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:448" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:448" { set +x $as_echo "$at_srcdir/glr-regression.at:448: \$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:448" ( $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:448" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:452: \$PREPARSER ./glr-regr4" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr4" "glr-regression.at:452" ( $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:452" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:452: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:452" ( $at_check_trace; 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:452" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_602 #AT_START_603 at_fn_group_banner 603 'glr-regression.at:462' \ "User destructor for unresolved GLR semantic value" "" 29 at_xfail=no ( $as_echo "603. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr5.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include static void yyerror (const char *msg); static int yylex (void); enum { MAGIC_VALUE = -1057808125 }; /* originally chosen at random */ %} %define parse.assert %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; } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:504: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr5.c -rall glr-regr5.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:504" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr5.c -rall 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:504" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:504: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c -rall glr-regr5.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c -rall glr-regr5.y" "glr-regression.at:504" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr5.c -rall 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:504" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:504: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:504" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:504" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:504: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:504" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:504" $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:504: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y" at_fn_check_prepare_trace "glr-regression.at:504" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr5.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:504" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:504: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y -Werror" "glr-regression.at:504" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:504" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr5.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:504: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:504" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:504" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:504: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y --warnings=error" "glr-regression.at:504" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:504" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:504: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y -Wnone,none -Werror --trace=none" "glr-regression.at:504" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:504" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:504: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y --warnings=none -Werror --trace=none" "glr-regression.at:504" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr5.c -rall glr-regr5.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:504" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:505" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:505" { set +x $as_echo "$at_srcdir/glr-regression.at:505: \$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:505" ( $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:505" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:509: \$PREPARSER ./glr-regr5" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr5" "glr-regression.at:509" ( $at_check_trace; $PREPARSER ./glr-regr5 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:509" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:509: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:509" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:509" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_603 #AT_START_604 at_fn_group_banner 604 'glr-regression.at:519' \ "User destructor after an error during a split parse" "" 29 at_xfail=no ( $as_echo "604. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr6.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include static void yyerror (const char *msg); static int yylex (void); %} %define parse.assert %glr-parser %union { int value; } %type 'a' %destructor { printf ("Destructor called.\n"); } 'a' %% start: 'a' | 'a' ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "a"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:553: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr6.c -rall glr-regr6.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr6.c -rall 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:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:553: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c -rall glr-regr6.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c -rall glr-regr6.y" "glr-regression.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr6.c -rall 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:553" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:553: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:553" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:553" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:553: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:553" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:553" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:553: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y" at_fn_check_prepare_trace "glr-regression.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr6.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:553" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:553: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y -Werror" "glr-regression.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:553" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr6.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:553: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:553" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:553" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:553: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y --warnings=error" "glr-regression.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:553" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:553: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y -Wnone,none -Werror --trace=none" "glr-regression.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:553" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:553: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y --warnings=none -Werror --trace=none" "glr-regression.at:553" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr6.c -rall glr-regr6.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:553" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:554" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:554" { set +x $as_echo "$at_srcdir/glr-regression.at:554: \$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:554" ( $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:554" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:560: \$PREPARSER ./glr-regr6" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr6" "glr-regression.at:560" ( $at_check_trace; $PREPARSER ./glr-regr6 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" echo >>"$at_stdout"; $as_echo "Destructor called. " | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:560" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:560: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:560" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:560" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_604 #AT_START_605 at_fn_group_banner 605 'glr-regression.at:570' \ "Duplicated user destructor for lookahead" " " 29 at_xfail=no ( $as_echo "605. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr7.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #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; %} %define parse.assert %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 = YY_CAST (count_node*, malloc (sizeof *yylval.node)); if (!yylval.node) { fprintf (stderr, "Test inconclusive.\n"); exit (EXIT_FAILURE); } yylval.node->count = 0; yylval.node->prev = tail; tail = yylval.node; return 'a'; } /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int main (void) { int status = yyparse (); while (tail) { count_node *prev = tail->prev; free (tail); tail = prev; } return status; } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:643: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr7.c -rall glr-regr7.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:643" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr7.c -rall 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:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:643: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c -rall glr-regr7.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c -rall glr-regr7.y" "glr-regression.at:643" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr7.c -rall 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:643" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:643: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:643" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:643" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:643: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:643" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: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/glr-regression.at:643: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y" at_fn_check_prepare_trace "glr-regression.at:643" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr7.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:643: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y -Werror" "glr-regression.at:643" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:643" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr7.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:643: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:643" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:643" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:643: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y --warnings=error" "glr-regression.at:643" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:643" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:643: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y -Wnone,none -Werror --trace=none" "glr-regression.at:643" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:643" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:643: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y --warnings=none -Werror --trace=none" "glr-regression.at:643" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr7.c -rall glr-regr7.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:643" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:644" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:644" { set +x $as_echo "$at_srcdir/glr-regression.at:644: \$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:644" ( $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:644" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:648: \$PREPARSER ./glr-regr7" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr7" "glr-regression.at:648" ( $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:648" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:648: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.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 >>"$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: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_605 #AT_START_606 at_fn_group_banner 606 'glr-regression.at:660' \ "Incorrectly initialized location for empty right-hand side in GLR" "" 29 at_xfail=no ( $as_echo "606. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr8.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include static void yyerror (const char *msg); static int yylex (void); %} %token T_CONSTANT %token T_PORT %token T_SIGNAL %define parse.assert %glr-parser %% PortClause : T_PORT InterfaceDeclaration T_PORT { printf("%d/%d - %d/%d - %d/%d\n", @1.first_column, @1.last_column, @2.first_column, @2.last_column, @3.first_column, @3.last_column); } ; InterfaceDeclaration : OptConstantWord %dprec 1 | OptSignalWord %dprec 2 ; OptConstantWord : %empty | T_CONSTANT ; OptSignalWord : %empty { printf("empty: %d/%d\n", @$.first_column, @$.last_column); } | T_SIGNAL ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } static int lexIndex; int yylex (void) { lexIndex += 1; switch (lexIndex) { default: abort (); case 1: yylloc.first_column = 1; yylloc.last_column = 9; return T_PORT; case 2: yylloc.first_column = 13; yylloc.last_column = 17; return T_PORT; case 3: return 0; } } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr8.c -rall glr-regr8.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr8.c -rall 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: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c -rall glr-regr8.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c -rall glr-regr8.y" "glr-regression.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr8.c -rall 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 \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:733: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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 \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y" at_fn_check_prepare_trace "glr-regression.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr8.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y -Werror" "glr-regression.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr8.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:733: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:733" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y --warnings=error" "glr-regression.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:733" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y -Wnone,none -Werror --trace=none" "glr-regression.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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; } { set +x $as_echo "$at_srcdir/glr-regression.at:733: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y --warnings=none -Werror --trace=none" "glr-regression.at:733" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr8.c -rall glr-regr8.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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; } at_restore_special_files fi $as_echo "glr-regression.at:734" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:734" { set +x $as_echo "$at_srcdir/glr-regression.at:734: \$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:734" ( $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:734" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:740: \$PREPARSER ./glr-regr8" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr8" "glr-regression.at:740" ( $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:740" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:740: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:740" ( $at_check_trace; 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:740" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_606 #AT_START_607 at_fn_group_banner 607 'glr-regression.at:750' \ "No users destructors if stack 0 deleted" " " 29 at_xfail=no ( $as_echo "607. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr9.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ # include # 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) %} %define parse.assert %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'; } /* 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:814: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr9.c -rall glr-regr9.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:814" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr9.c -rall 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:814" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:814: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c -rall glr-regr9.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c -rall glr-regr9.y" "glr-regression.at:814" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr9.c -rall 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:814" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:814: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:814" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:814" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:814: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:814" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:814" $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:814: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y" at_fn_check_prepare_trace "glr-regression.at:814" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr9.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:814" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:814: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y -Werror" "glr-regression.at:814" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:814" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr9.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:814: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:814" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:814" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:814: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y --warnings=error" "glr-regression.at:814" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:814" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:814: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y -Wnone,none -Werror --trace=none" "glr-regression.at:814" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:814" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:814: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y --warnings=none -Werror --trace=none" "glr-regression.at:814" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr9.c -rall glr-regr9.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:814" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:815" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:815" { set +x $as_echo "$at_srcdir/glr-regression.at:815: \$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:815" ( $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:815" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:819: \$PREPARSER ./glr-regr9" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr9" "glr-regression.at:819" ( $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:819" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:819: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:819" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:819" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_607 #AT_START_608 at_fn_group_banner 608 'glr-regression.at:828' \ "Corrupted semantic options if user action cuts parse" "" 29 at_xfail=no ( $as_echo "608. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr10.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ # include # include #include static void yyerror (const char *msg); static int yylex (void); #define GARBAGE_SIZE 50 static char garbage[GARBAGE_SIZE]; %} %define parse.assert %glr-parser %union { char *ptr; } %type start %% start: %dprec 2 { $$ = garbage; YYACCEPT; } | %dprec 1 { $$ = garbage; YYACCEPT; } ; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = ""; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:871: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr10.c -rall glr-regr10.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:871" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr10.c -rall 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:871" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:871: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c -rall glr-regr10.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c -rall glr-regr10.y" "glr-regression.at:871" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr10.c -rall 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:871" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:871: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:871" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:871" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:871: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:871" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:871" $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:871: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y" at_fn_check_prepare_trace "glr-regression.at:871" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr10.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:871" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:871: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y -Werror" "glr-regression.at:871" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:871" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr10.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:871: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:871" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:871" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:871: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y --warnings=error" "glr-regression.at:871" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:871" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:871: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y -Wnone,none -Werror --trace=none" "glr-regression.at:871" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:871" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:871: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y --warnings=none -Werror --trace=none" "glr-regression.at:871" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr10.c -rall glr-regr10.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:871" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:872" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:872" { 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_608 #AT_START_609 at_fn_group_banner 609 'glr-regression.at:883' \ "Undesirable destructors if user action cuts parse" "" 29 at_xfail=no ( $as_echo "609. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr11.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ # include #include static void yyerror (const char *msg); static int yylex (void); static int destructors = 0; # define USE(val) %} %define parse.assert %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; } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr11.c -rall glr-regr11.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr11.c -rall 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:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c -rall glr-regr11.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c -rall glr-regr11.y" "glr-regression.at:930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr11.c -rall 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:930" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:930: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:930" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:930" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:930: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:930" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:930" $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:930: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y" at_fn_check_prepare_trace "glr-regression.at:930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr11.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:930" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y -Werror" "glr-regression.at:930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:930" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr11.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:930: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:930" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:930" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y --warnings=error" "glr-regression.at:930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:930" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y -Wnone,none -Werror --trace=none" "glr-regression.at:930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:930" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:930: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y --warnings=none -Werror --trace=none" "glr-regression.at:930" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr11.c -rall glr-regr11.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:930" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:931" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:931" { set +x $as_echo "$at_srcdir/glr-regression.at:931: \$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:931" ( $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:931" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:933: \$PREPARSER ./glr-regr11" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr11" "glr-regression.at:933" ( $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:933" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:933: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:933" ( $at_check_trace; 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:933" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_609 #AT_START_610 at_fn_group_banner 610 'glr-regression.at:942' \ "Leaked semantic values if user action cuts parse" "" 29 at_xfail=no ( $as_echo "610. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr12.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.assert %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); #include 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. */ return s1.dummy + s2.dummy; } /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:1052: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr12.c -rall glr-regr12.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1052" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr12.c -rall 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:1052" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1052: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c -rall glr-regr12.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c -rall glr-regr12.y" "glr-regression.at:1052" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr12.c -rall 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:1052" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1052: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1052" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1052" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1052: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1052" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1052" $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:1052: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y" at_fn_check_prepare_trace "glr-regression.at:1052" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr12.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] glr-regr12.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1052" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:1052: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y -Werror" "glr-regression.at:1052" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1052" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr12.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] glr-regr12.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:1052: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1052" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1052" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:1052: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y --warnings=error" "glr-regression.at:1052" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1052" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:1052: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y -Wnone,none -Werror --trace=none" "glr-regression.at:1052" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1052" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1052: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y --warnings=none -Werror --trace=none" "glr-regression.at:1052" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr12.c -rall glr-regr12.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1052" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:1053" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:1053" { set +x $as_echo "$at_srcdir/glr-regression.at:1053: \$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:1053" ( $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:1053" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1055: \$PREPARSER ./glr-regr12" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr12" "glr-regression.at:1055" ( $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:1055" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1055: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1055" ( $at_check_trace; 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:1055" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_610 #AT_START_611 at_fn_group_banner 611 'glr-regression.at:1066' \ "Incorrect lookahead during deterministic GLR" " " 29 at_xfail=no ( $as_echo "611. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr13.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #include static void yyerror (const char *msg); static int yylex (void); static void print_lookahead (char const *); #define USE(value) %} %define parse.assert %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'; } ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; yylval.value = YY_CAST (char, 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:1168: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr13.c -rall glr-regr13.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1168" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr13.c -rall 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:1168" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1168: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c -rall glr-regr13.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c -rall glr-regr13.y" "glr-regression.at:1168" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr13.c -rall 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:1168" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1168: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1168" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1168" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1168: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1168" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1168" $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:1168: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr13.c -rall glr-regr13.y" at_fn_check_prepare_trace "glr-regression.at:1168" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr13.c -rall 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:1168" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "glr-regression.at:1169" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:1169" { set +x $as_echo "$at_srcdir/glr-regression.at:1169: \$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:1169" ( $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:1169" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1182: \$PREPARSER ./glr-regr13" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr13" "glr-regression.at:1182" ( $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:1182" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1182: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1182" ( $at_check_trace; 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:1182" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_611 #AT_START_612 at_fn_group_banner 612 'glr-regression.at:1191' \ "Incorrect lookahead during nondeterministic GLR" "" 29 at_xfail=no ( $as_echo "612. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr14.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } /* 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 #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) %} %define parse.assert %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"); } } ; %% /* 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 int toknum = 0; assert (toknum < YY_CAST (int, sizeof input)); yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = toknum + 1; yylval.value = YY_CAST (char, 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) { return YY_CAST (char, s1.value + s2.value); } 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:1383: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr14.c -rall glr-regr14.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1383" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr14.c -rall 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:1383" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1383: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c -rall glr-regr14.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c -rall glr-regr14.y" "glr-regression.at:1383" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr14.c -rall 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:1383" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1383: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1383" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1383" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1383: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1383" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1383" $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:1383: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y" at_fn_check_prepare_trace "glr-regression.at:1383" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr14.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1383" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:1383: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y -Werror" "glr-regression.at:1383" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1383" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr14.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:1383: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1383" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1383" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:1383: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y --warnings=error" "glr-regression.at:1383" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1383" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:1383: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y -Wnone,none -Werror --trace=none" "glr-regression.at:1383" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1383" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1383: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y --warnings=none -Werror --trace=none" "glr-regression.at:1383" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr14.c -rall glr-regr14.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1383" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:1384" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:1384" { set +x $as_echo "$at_srcdir/glr-regression.at:1384: \$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:1384" ( $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:1384" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1399: \$PREPARSER ./glr-regr14" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr14" "glr-regression.at:1399" ( $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:1399" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1399: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1399" ( $at_check_trace; 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:1399" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_612 #AT_START_613 at_fn_group_banner 613 'glr-regression.at:1408' \ "Leaked semantic values when reporting ambiguity" "" 29 at_xfail=no ( $as_echo "613. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr15.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.assert %glr-parser %destructor { parent_rhs_before_value = 0; } parent_rhs_before %{ # include #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: ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:1477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr15.c -rall glr-regr15.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr15.c -rall 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:1477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c -rall glr-regr15.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c -rall glr-regr15.y" "glr-regression.at:1477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr15.c -rall 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:1477" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1477" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1477: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1477" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1477" $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:1477: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y" at_fn_check_prepare_trace "glr-regression.at:1477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr15.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1477" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:1477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y -Werror" "glr-regression.at:1477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1477" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr15.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:1477: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1477" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1477" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:1477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y --warnings=error" "glr-regression.at:1477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1477" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:1477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y -Wnone,none -Werror --trace=none" "glr-regression.at:1477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1477" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1477: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y --warnings=none -Werror --trace=none" "glr-regression.at:1477" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr15.c -rall glr-regr15.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1477" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:1478" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:1478" { set +x $as_echo "$at_srcdir/glr-regression.at:1478: \$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:1478" ( $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:1478" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1482: \$PREPARSER ./glr-regr15" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr15" "glr-regression.at:1482" ( $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:1482" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1482: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1482" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1482" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_613 #AT_START_614 at_fn_group_banner 614 'glr-regression.at:1491' \ "Leaked lookahead after nondeterministic parse syntax error" "" 29 at_xfail=no ( $as_echo "614. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr16.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.assert %glr-parser %destructor { lookahead_value = 0; } 'b' %{ # include # 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: ; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); 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:1538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr16.c -rall glr-regr16.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr16.c -rall 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:1538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c -rall glr-regr16.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c -rall glr-regr16.y" "glr-regression.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr16.c -rall 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:1538" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1538: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1538" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1538" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1538: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1538" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1538" $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:1538: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y" at_fn_check_prepare_trace "glr-regression.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr16.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1538" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:1538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y -Werror" "glr-regression.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1538" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr16.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:1538: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1538" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1538" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:1538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y --warnings=error" "glr-regression.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1538" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:1538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y -Wnone,none -Werror --trace=none" "glr-regression.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1538" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1538: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y --warnings=none -Werror --trace=none" "glr-regression.at:1538" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr16.c -rall glr-regr16.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1538" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:1539" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:1539" { set +x $as_echo "$at_srcdir/glr-regression.at:1539: \$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:1539" ( $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:1539" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1543: \$PREPARSER ./glr-regr16" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr16" "glr-regression.at:1543" ( $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:1543" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1543: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1543" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1543" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_614 #AT_START_615 at_fn_group_banner 615 'glr-regression.at:1552' \ "Uninitialized location when reporting ambiguity" "" 29 at_xfail=no ( $as_echo "615. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr17.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.assert %glr-parser %locations %define api.pure %define parse.error verbose %union { int dummy; } %{ #include #if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL static int location_print (FILE *yyo, YYLTYPE const * const yylocp); # ifndef LOCATION_PRINT # define LOCATION_PRINT(File, Loc) location_print (File, &(Loc)) # endif #endif static void yyerror (YYLTYPE const * const llocp, const char *msg); static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp); %} %% /* Tests the case of an empty RHS that has inherited the location of the previous nonterminal, which is unresolved. That location is reported as the last position of the ambiguity. */ start: ambig1 empty1 | ambig2 empty2 ; /* Tests multiple levels of yyresolveLocations recursion. */ ambig1: sub_ambig1 | sub_ambig2 ; ambig2: sub_ambig1 | sub_ambig2 ; /* Tests the case of a non-empty RHS as well as the case of an empty RHS that has inherited the initial location. The empty RHS's location is reported as the first position in the ambiguity. */ sub_ambig1: empty1 'a' 'b' ; sub_ambig2: empty2 'a' 'b' ; empty1: ; empty2: ; %% # include # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL /* Print *YYLOCP on YYO. */ __attribute__((__unused__)) static int location_print (FILE *yyo, YYLTYPE const * const yylocp) { int res = 0; int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; if (0 <= yylocp->first_line) { res += fprintf (yyo, "%d", yylocp->first_line); if (0 <= yylocp->first_column) res += fprintf (yyo, ".%d", yylocp->first_column); } if (0 <= yylocp->last_line) { if (yylocp->first_line < yylocp->last_line) { res += fprintf (yyo, "-%d", yylocp->last_line); if (0 <= end_col) res += fprintf (yyo, ".%d", end_col); } else if (0 <= end_col && yylocp->first_column < end_col) res += fprintf (yyo, "-%d", end_col); } return res; } #endif /* A C error reporting function. */ static void yyerror (YYLTYPE const * const llocp, const char *msg) { LOCATION_PRINT (stderr, (*llocp)); fprintf (stderr, ": "); fprintf (stderr, "%s\n", msg); } static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp) { static char const input[] = "ab"; static int toknum = 0; assert (toknum < YY_CAST (int, sizeof input)); lvalp->dummy = 0; llocp->first_line = llocp->last_line = 2; llocp->first_column = toknum + 1; llocp->last_column = llocp->first_column + 1; return input[toknum++]; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then at_save_special_files mkdir xml-tests # Don't combine these Bison invocations since we want to be sure that # --report=all isn't required to get the full XML file. { set +x $as_echo "$at_srcdir/glr-regression.at:1613: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o glr-regr17.c -rall glr-regr17.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1613" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o glr-regr17.c -rall 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:1613" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1613: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c -rall glr-regr17.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c -rall glr-regr17.y" "glr-regression.at:1613" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o glr-regr17.c -rall 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:1613" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1613: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1613" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1613" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1613: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1613" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1613" $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:1613: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y" at_fn_check_prepare_trace "glr-regression.at:1613" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr17.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1613" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:1613: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y -Werror" "glr-regression.at:1613" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1613" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' glr-regr17.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:1613: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1613" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1613" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:1613: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y --warnings=error" "glr-regression.at:1613" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1613" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:1613: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y -Wnone,none -Werror --trace=none" "glr-regression.at:1613" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1613" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1613: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y --warnings=none -Werror --trace=none" "glr-regression.at:1613" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr17.c -rall glr-regr17.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1613" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:1614" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:1614" { set +x $as_echo "$at_srcdir/glr-regression.at:1614: \$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:1614" ( $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:1614" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1618: \$PREPARSER ./glr-regr17" at_fn_check_prepare_dynamic " $PREPARSER ./glr-regr17" "glr-regression.at:1618" ( $at_check_trace; $PREPARSER ./glr-regr17 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1618" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1618: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1618" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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:1618" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_615 #AT_START_616 at_fn_group_banner 616 'glr-regression.at:1627' \ "Missed %merge type warnings when LHS type is declared later" "" 29 at_xfail=no ( $as_echo "616. $at_setup_line: testing $at_desc ..." $at_traceon cat >glr-regr18.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.assert %glr-parser %{ #include #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; %% /* 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 int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { (void) argc; (void) argv; return yyparse (); } _ATEOF { set +x $as_echo "$at_srcdir/glr-regression.at:1667: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr18.c -rall glr-regr18.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr18.c -rall glr-regr18.y" "glr-regression.at:1667" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o glr-regr18.c -rall glr-regr18.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "glr-regr18.y:28.18-24: error: result type clash on merge function 'merge': != glr-regr18.y:27.18-24: previous declaration glr-regr18.y:29.13-19: error: result type clash on merge function 'merge': != glr-regr18.y:28.18-24: previous declaration " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at: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_616 #AT_START_617 at_fn_group_banner 617 'glr-regression.at:1676' \ "Ambiguity reports" " " 29 at_xfail=no ( $as_echo "617. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %{ #include #include #include static void yyerror (const char *msg); static int yylex (void); %} %define parse.assert %debug %glr-parser %% start: 'a' b 'c' d | 'a' b 'c' d ; b: 'b'; d: /* nada. */; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } #include static int yylex (void) { static char const input[] = "abc"; static int toknum = 0; int res; enum { input_elts = sizeof input / sizeof input[0] }; (void) input_elts; assert (0 <= toknum && toknum < input_elts); res = input[toknum++]; ; return res; } #include /* getenv. */ #include /* strcmp. */ int main (int argc, char const* argv[]) { yydebug = !!getenv ("YYDEBUG"); for (int i = 1; i < argc; ++i) if (!strcmp (argv[i], "-p") || !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug")) yydebug |= 1; else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat")) yydebug |= 2; 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:1707: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1707" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1707: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "glr-regression.at:1707" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1707" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1707: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1707" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1707" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1707: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1707" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1707" $at_failed && at_fn_log_failure $at_traceon; } rm -rf xml-tests expout at_restore_special_files fi { set +x $as_echo "$at_srcdir/glr-regression.at:1707: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "glr-regression.at:1707" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] " | \ $at_diff - "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1707" $at_failed && at_fn_log_failure $at_traceon; } # Defining POSIXLY_CORRECT causes bison to complain if options are # added after the grammar file name, so skip these checks in that # case. if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then at_save_special_files # To avoid expanding it repeatedly, store specified stdout. : >expout # Run with -Werror. { set +x $as_echo "$at_srcdir/glr-regression.at:1707: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "glr-regression.at:1707" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1707" $at_failed && at_fn_log_failure $at_traceon; } if test x"$PERL" != x; then # Build expected stderr up to and including the "warnings being # treated as errors" message. cat >experr <<'_ATEOF' input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr] _ATEOF "$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \ -e 's{\[-W(.*)\]$}{[-Werror=$1]}' \ experr { set +x $as_echo "$at_srcdir/glr-regression.at:1707: sed 's,.*/\$,,' stderr 1>&2" at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "glr-regression.at:1707" ( $at_check_trace; sed 's,.*/$,,' stderr 1>&2 ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1707" $at_failed && at_fn_log_failure $at_traceon; } # Now check --warnings=error. cp stderr experr { set +x $as_echo "$at_srcdir/glr-regression.at:1707: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "glr-regression.at:1707" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter $at_diff experr "$at_stderr" || at_failed=: $at_diff expout "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1707" $at_failed && at_fn_log_failure $at_traceon; } fi # Now check -Wnone and --warnings=none by making sure that # -Werror doesn't change the exit status when -Wnone or # --warnings=none is specified. With traces disabled, there should # be no output on stderr. { set +x $as_echo "$at_srcdir/glr-regression.at:1707: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "glr-regression.at:1707" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1707" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1707: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "glr-regression.at:1707" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1707" $at_failed && at_fn_log_failure $at_traceon; } at_restore_special_files fi $as_echo "glr-regression.at:1708" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:1708" { set +x $as_echo "$at_srcdir/glr-regression.at:1708: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS" at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "glr-regression.at:1708" ( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1708" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1766: \$PREPARSER ./input --debug" at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "glr-regression.at:1766" ( $at_check_trace; $PREPARSER ./input --debug ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; tee stderr <"$at_stderr" at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 1 $at_status "$at_srcdir/glr-regression.at:1766" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1766: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1766" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo >>"$at_stderr"; $as_echo "Starting parse Entering state 0 Reading a token: Next token is token 'a' () Shifting token 'a' () Entering state 1 Reading a token: Next token is token 'b' () Shifting token 'b' () Entering state 3 Reducing stack 0 by rule 3 (line 27): \$1 = token 'b' () -> \$\$ = nterm b () Entering state 4 Reading a token: Next token is token 'c' () Shifting token 'c' () Entering state 6 Reducing stack 0 by rule 4 (line 28): -> \$\$ = nterm d () Entering state 7 Reading a token: Now at end of input. Stack 0 Entering state 7 Now at end of input. Splitting off stack 1 from 0. Reduced stack 1 by rule 2 (line 24); action deferred. Now in state 2. Stack 1 Entering state 2 Now at end of input. Reduced stack 0 by rule 1 (line 24); 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:1766" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_617 #AT_START_618 at_fn_group_banner 618 'glr-regression.at:1778' \ "Predicates" " " 29 at_xfail=no ( $as_echo "618. $at_setup_line: testing $at_desc ..." $at_traceon cat >input.y <<'_ATEOF' %code top { /* Adjust to the compiler. We used to do it here, but each time we add a new line, we have to adjust all the line numbers in error messages. It's simpler to use a constant include to a varying file. */ #include } %define parse.assert %glr-parser %define parse.error verbose %expect-rr 1 %code requires { #include #include bool new_syntax = false; const char *input = YY_NULLPTR; #include static void yyerror (const char *msg); static int yylex (void); } %% widget: %? {new_syntax} 'w' id new_args { printf("new"); } | %?{!new_syntax} 'w' id old_args { printf("old"); } ; id: 'i'; new_args: 'n'; old_args: 'o'; %% /* A C error reporting function. */ static void yyerror (const char *msg) { fprintf (stderr, "%s\n", msg); } int yylex (void) { return *input++; } int main (int argc, const char* argv[]) { assert (argc == 2); (void) argc; // First char decides whether new, or old syntax. // Then the input. new_syntax = argv[1][0] == 'N'; input = argv[1] + 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:1823: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\ --graph=xml-tests/test.gv -o input.c input.y" at_fn_check_prepare_notrace 'an embedded newline' "glr-regression.at:1823" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \ --graph=xml-tests/test.gv -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_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:1823" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1823: COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "glr-regression.at:1823" ( $at_check_trace; COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter echo stderr:; cat "$at_stderr" echo stdout:; cat "$at_stdout" at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1823" $at_failed && at_fn_log_failure $at_traceon; } cp xml-tests/test.output expout { set +x $as_echo "$at_srcdir/glr-regression.at:1823: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --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:1823" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \ xml-tests/test.xml ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1823" $at_failed && at_fn_log_failure $at_traceon; } sort xml-tests/test.gv > expout { set +x $as_echo "$at_srcdir/glr-regression.at:1823: \$XSLTPROC \\ \`COLUMNS=1000; export COLUMNS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-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:1823" ( $at_check_trace; $XSLTPROC \ `COLUMNS=1000; export COLUMNS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \ xml-tests/test.xml | sort ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter 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:1823" $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:1823: COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y" at_fn_check_prepare_trace "glr-regression.at:1823" ( $at_check_trace; COLUMNS=1000; export COLUMNS; bison --color=no -fno-caret -o input.c input.y ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_filter at_fn_diff_devnull "$at_stderr" || at_failed=: at_fn_diff_devnull "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1823" $at_failed && at_fn_log_failure $at_traceon; } $as_echo "glr-regression.at:1824" >"$at_check_line_file" (! $BISON_C_WORKS) \ && at_fn_check_skip 77 "$at_srcdir/glr-regression.at:1824" { set +x $as_echo "$at_srcdir/glr-regression.at:1824: \$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:1824" ( $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:1824" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1825: \$PREPARSER ./input Nwin" at_fn_check_prepare_dynamic " $PREPARSER ./input Nwin" "glr-regression.at:1825" ( $at_check_trace; $PREPARSER ./input Nwin ) >>"$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 "new" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1825" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1825: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1825" ( $at_check_trace; 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:1825" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1827: \$PREPARSER ./input Owin" at_fn_check_prepare_dynamic " $PREPARSER ./input Owin" "glr-regression.at:1827" ( $at_check_trace; $PREPARSER ./input Owin ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1827" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1827: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1827" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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 'n', expecting 'o' " | \ $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:1827" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1828: \$PREPARSER ./input Owio" at_fn_check_prepare_dynamic " $PREPARSER ./input Owio" "glr-regression.at:1828" ( $at_check_trace; $PREPARSER ./input Owio ) >>"$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 "old" | \ $at_diff - "$at_stdout" || at_failed=: at_fn_check_status 0 $at_status "$at_srcdir/glr-regression.at:1828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1828: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1828" ( $at_check_trace; 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:1828" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1830: \$PREPARSER ./input Nwio" at_fn_check_prepare_dynamic " $PREPARSER ./input Nwio" "glr-regression.at:1830" ( $at_check_trace; $PREPARSER ./input Nwio ) >>"$at_stdout" 2>>"$at_stderr" 5>&- at_status=$? at_failed=false $at_check_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:1830" $at_failed && at_fn_log_failure $at_traceon; } { set +x $as_echo "$at_srcdir/glr-regression.at:1830: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr" at_fn_check_prepare_trace "glr-regression.at:1830" ( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge 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 'o', expecting 'n' " | \ $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:1830" $at_failed && at_fn_log_failure $at_traceon; } set +x $at_times_p && times >"$at_times_file" ) 5>&1 2>&1 7>&- | eval $at_tee_pipe read at_status <"$at_status_file" #AT_STOP_618