X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/4e8c79eb7ff24dd31ce7d1f6be8a164aea505185..fcbfa6b01c0222b01254730c66d539ed2c841a4e:/tests/calc.at?ds=inline diff --git a/tests/calc.at b/tests/calc.at index d566c1db..7cf12d39 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -46,14 +46,13 @@ 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; +typedef int value; -static value_t global_result = 0; +static value global_result = 0; static int global_count = 0; %} @@ -61,7 +60,7 @@ static int global_count = 0; /* Exercise %union. */ %union { - value_t ival; + value ival; }; %{ @@ -96,7 +95,7 @@ static int power (int base, int exponent); - %location & %pure & %glr - %location & %pure & %yacc & %parse-param. */ static void yyerror (]AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])[ - ]AT_PARAM_IF([value_t *result, int *count, ])[ + ]AT_PARAM_IF([value *result, int *count, ])[ const char *s ); static int yylex (LEX_FORMALS); @@ -150,7 +149,7 @@ static FILE *yyin; static void yyerror (]AT_YYERROR_ARG_LOC_IF([YYLTYPE *yylloc, ])[ - ]AT_PARAM_IF([value_t *result, int *count, ])[ + ]AT_PARAM_IF([value *result, int *count, ])[ const char *s ) { @@ -289,7 +288,7 @@ power (int base, int exponent) int main (int argc, const char **argv) { - value_t result = 0; + value result = 0; int count = 0; int status; @@ -308,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; } ]]) @@ -561,7 +562,7 @@ AT_CHECK_CALC_LALR([%error-verbose %debug %locations %defines %name-prefix="calc AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc]) -AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {value_t *result}, {result} %parse-param {int *count}, {count}]) +AT_CHECK_CALC_LALR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {value *result} %parse-param {int *count}]) # ----------------------- # @@ -596,4 +597,4 @@ AT_CHECK_CALC_GLR([%error-verbose %debug %locations %defines %name-prefix="calc" AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc]) -AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {value_t *result}, {result} %parse-param {int *count}, {count}]) +AT_CHECK_CALC_GLR([%pure-parser %error-verbose %debug %locations %defines %name-prefix="calc" %verbose %yacc %parse-param {value *result} %parse-param {int *count}])