X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/6e649e659ebc2d8b54fa4636986370b76c2ff988..bb92250c78de62973527486051533f6dec9afeee:/tests/calc.at diff --git a/tests/calc.at b/tests/calc.at index e79cdb2e..63c3233f 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -46,15 +46,14 @@ AT_DATA_GRAMMAR([calc.y], # include #endif #include -#include extern void perror (const char *s); /* Exercise pre-prologue dependency to %union. */ typedef int value_t; -value_t global_result = 0; -int global_count = 0; +static value_t global_result = 0; +static int global_count = 0; %} @@ -146,7 +145,7 @@ exp: ; %% /* The input. */ -FILE *yyin; +static FILE *yyin; static void yyerror (]AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])[ @@ -291,8 +290,7 @@ main (int argc, const char **argv) { value_t result = 0; int count = 0; - int status = 0; - yyin = NULL; + int status; if (argc == 2) yyin = fopen (argv[1], "r"); @@ -309,8 +307,10 @@ main (int argc, const char **argv) yydebug = 1; #endif status = yyparse (]AT_PARAM_IF([&result, &count])[); - assert (global_result == result); - assert (global_count == count); + if (global_result != result) + abort (); + if (global_count != count) + abort (); return status; } ]])