From bc31dee0f7ba982813949204e47120d1c160b394 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Thu, 13 Dec 2018 21:38:38 +0100 Subject: [PATCH] tests: isolate test about Yacc warnings * tests/input.at (Yacc warnings): New. (AT_CHECK_UNUSED_VALUES): Remove checks about yacc. --- tests/input.at | 64 +++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/tests/input.at b/tests/input.at index 47b584c6..165bfaef 100644 --- a/tests/input.at +++ b/tests/input.at @@ -161,6 +161,40 @@ input.y:4.6-13: warning: POSIX Yacc does not support string literals [-Wyacc] AT_CLEANUP +## --------------- ## +## Yacc warnings. ## +## --------------- ## + +AT_SETUP([Yacc warnings]) + +AT_DATA([input.y], +[[%destructor {} +%printer {} +%type exp a b +%% +exp: a b { $$ = $1 + $2; }; +a: { $$ = 42; } { $$ = $1; }; +b: %empty { $$ = 42; }; +]]) + +AT_BISON_CHECK([-fcaret -Wyacc input.y], [0], [], +[[input.y:1.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] + %destructor {} + ^^^^^^^^^^^ +input.y:2.1-8: warning: POSIX Yacc does not support %printer [-Wyacc] + %printer {} + ^^^^^^^^ +input.y:6.9-20: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] + a: { $$ = 42; } { $$ = $1; }; + ^^^^^^^^^^^^ +input.y:7.4-9: warning: POSIX Yacc does not support %empty [-Wyacc] + b: %empty { $$ = 42; }; + ^^^^^^ +]]) + +AT_CLEANUP + + ## --------------------- ## ## Invalid %nterm uses. ## ## --------------------- ## @@ -447,36 +481,6 @@ input.y:26.40-42: warning: unset value: $][$ [-Wother] ^^^ ]]) -AT_BISON_CHECK([-Wnone,yacc -fcaret input.y], - [0], [], -[m4_ifval([$1], [], [[input.y:3.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] - %destructor { destroy ($$); } ; - ^^^^^^^^^^^ -]])[input.y:13.10-15: warning: POSIX Yacc does not support %empty [-Wyacc] - b: INT | %empty; - ^^^^^^ -input.y:24.23-34: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] - m: INT | INT { $][$ = $][1; } INT { $][$ = $][2 + $][3; } INT { $][$ = $][4 + $][5; }; - ^^^^^^^^^^^^ -input.y:24.49-65: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] - m: INT | INT { $][$ = $][1; } INT { $][$ = $][2 + $][3; } INT { $][$ = $][4 + $][5; }; - ^^^^^^^^^^^^^^^^^ -input.y:25.23-25: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] - n: INT | INT { } INT { } INT { }; - ^^^ -input.y:25.40-42: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] - n: INT | INT { } INT { } INT { }; - ^^^ -input.y:26.23-25: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] - o: INT | INT { } INT { } INT { $][$ = $][1 + $][2 + $][3 + $][4 + $][5; }; - ^^^ -input.y:26.40-42: warning: POSIX Yacc does not support typed midrule actions [-Wyacc] - o: INT | INT { } INT { } INT { $][$ = $][1 + $][2 + $][3 + $][4 + $][5; }; - ^^^ -]m4_ifval([$1], [[input.y:30.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc] - %destructor { destroy ($$); } ; - ^^^^^^^^^^^ -]])]) ]) ## --------------- ##