X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/817e9f41d135945f3caa781ceab68a112edc5613..a05fafb9444b70bdfe9e3af769083ff7d8a39498:/tests/torture.at diff --git a/tests/torture.at b/tests/torture.at index 83c4a21c..deb5ab1d 100644 --- a/tests/torture.at +++ b/tests/torture.at @@ -60,7 +60,7 @@ EOF for my $size (1 .. $max) { - print "%token \"$size\" ", $size * 10, "\n"; + print "%token \"$size\" ", $size, "\n"; }; print < +#include +#include + +#define YYERROR_VERBOSE 1 +#define YYDEBUG 1 + +static int yylex (void); +static void yyerror (const char *msg); +%} +EOF + +for my $size (1 .. $max) + { + print "%token \"$size\" ", $size, "\n"; + }; + +print < $max) + return 0; + else + return counter++; +} + +static void +yyerror (const char *msg) +{ + fprintf (stderr, "%s\\n", msg); +} + +int +main (void) +{ + yydebug = !!getenv ("YYDEBUG"); + return yyparse (); +} +EOF +]]) + +AT_CHECK([perl -w ./gengram.pl $2 || exit 77], 0, [stdout]) +mv stdout $1 +]) + + +## ---------------- ## +## Big horizontal. ## +## ---------------- ## + +AT_SETUP([Big horizontal]) + +# 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 +# +AT_DATA_HORIZONTAL_GRAMMAR([input.y], [1000]) AT_CHECK([bison input.y -v -o input.c]) AT_CHECK([$CC $CFLAGS $CPPFLAGS input.c -o input], 0, [], [ignore]) AT_CHECK([./input])