X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/da730230ce159265f4380daa456e3e3c5f9422f4..5f7f1e210b45977270f16532629107eb5c18227d:/tests/torture.at diff --git a/tests/torture.at b/tests/torture.at index 753fc919..3fff08e6 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -1,6 +1,7 @@ # Torturing Bison. -*- Autotest -*- -# Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, -# Inc. + +# Copyright (C) 2001-2002, 2004-2007, 2009-2012 Free Software +# Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -55,8 +56,8 @@ print < #include -static int yylex (void); -static void yyerror (const char *msg); +]AT_YYLEX_DECLARE[ +]AT_YYERROR_DECLARE[ %} %union { @@ -170,8 +171,8 @@ print < #include -static int yylex (void); -static void yyerror (const char *msg); +]AT_YYLEX_DECLARE[ +]AT_YYERROR_DECLARE[ %} %token @@ -277,8 +278,8 @@ print < # include -static int yylex (void); -static void yyerror (const char *msg); +]AT_YYLEX_DECLARE[ +]AT_YYERROR_DECLARE[ %} %union { @@ -389,7 +390,8 @@ AT_CLEANUP # ------------------------------------------------ # A parser specialized in torturing the stack size. m4_define([AT_DATA_STACK_TORTURE], -[# A grammar of parens growing the stack thanks to right recursion. +[AT_BISON_OPTION_PUSHDEFS([$2]) +# A grammar of parens growing the stack thanks to right recursion. # exp: AT_DATA([input.y], [[%{ @@ -398,8 +400,8 @@ AT_DATA([input.y], #include #include ]$1[ - static int yylex (void); - static void yyerror (const char *msg); + ]AT_YYLEX_DECLARE[ + ]AT_YYERROR_DECLARE[ %} ]$2[ %error-verbose @@ -408,12 +410,7 @@ AT_DATA([input.y], %% exp: WAIT_FOR_EOF exp | ; %% -static void -yyerror (const char *msg) -{ - fprintf (stderr, "%s\n", msg); -} - +]AT_YYERROR_DEFINE[ static int yylex (void) { @@ -461,6 +458,7 @@ main (int argc, const char **argv) } } ]]) +AT_BISON_OPTION_POPDEFS([$2]) AT_BISON_CHECK([-o input.c input.y]) AT_COMPILE([input]) ]) @@ -496,7 +494,7 @@ AT_PARSER_CHECK([./input 10000], 2, [], [ignore], # just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect # push parsers. AT_DATA_STACK_TORTURE([AT_USE_ALLOCA], -[[%define api.push_pull "both" +[[%define api.push-pull both ]]) AT_PARSER_CHECK([./input 20], 0, [], [ignore], [[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]]) @@ -534,7 +532,7 @@ AT_PARSER_CHECK([./input 10000], 2, [], [ignore], [[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]]) AT_DATA_STACK_TORTURE([AT_USE_ALLOCA], -[[%define api.push_pull "both" +[[%define api.push-pull both ]]) AT_PARSER_CHECK([./input 20], 0, [], [ignore], [[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])