summaryrefslogtreecommitdiff
path: root/tests/regression.at
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-09-06 17:47:16 +0200
committerAkim Demaille <akim.demaille@gmail.com>2019-09-07 17:09:43 +0200
commit378963b1396272a1707e2f888dea7e2376a0e8ae (patch)
tree4531c42e8190812d79f0284275480668bab90afa /tests/regression.at
parent2dd882bce5a37996cbcaa9a646cde7221d30ad7d (diff)
downloadbison-378963b1396272a1707e2f888dea7e2376a0e8ae.tar.gz
tests: check token redeclaration
* src/symtab.c (symbol_class_set): Report previous definitions when redeclared. * tests/input.at (Symbol redeclared): New.
Diffstat (limited to 'tests/regression.at')
-rw-r--r--tests/regression.at9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/regression.at b/tests/regression.at
index 507bcbb4..55a3c95b 100644
--- a/tests/regression.at
+++ b/tests/regression.at
@@ -397,19 +397,18 @@ AT_BISON_OPTION_POPDEFS
# unnecessarily escaped here even though it would need to be if encoded in a
# C-string literal. Also notice that unnecessary escaping, such as "\?", from
# the user specification is eliminated.
-AT_BISON_CHECK([-o input.c input.y], [[0]], [[]],
-[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
-input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
-]])
-
AT_BISON_CHECK([-fcaret -o input.c input.y], [[0]], [[]],
[[input.y:22.8-14: warning: symbol SPECIAL redeclared [-Wother]
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
| ^~~~~~~
+input.y:21.8-14: previous declaration
+ 21 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
+ | ^~~~~~~
input.y:22.16-63: warning: symbol "\\'?\"\a\b\f\n\r\t\v\001\201\001\201??!" used more than once as a literal string [-Wother]
22 | %token SPECIAL "\\\'\?\"\a\b\f\n\r\t\v\001\201\x001\x000081??!"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
]])
+
AT_COMPILE([input])
# Checking the error message here guarantees that yytname, which does contain