summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkim Demaille <akim@lrde.epita.fr>2012-10-12 10:10:18 +0200
committerAkim Demaille <akim@lrde.epita.fr>2012-10-22 12:17:37 +0200
commitae2199381ee5eef2379e34376b77a36d99739cb6 (patch)
tree302affade489b42cedc0f276f47144c41a0c1193
parent7b70847e5834fdb3265db8629167353b86b43173 (diff)
downloadbison-ae2199381ee5eef2379e34376b77a36d99739cb6.tar.gz
tests: check %no-lines
* tests/synclines.at: here.
-rw-r--r--tests/synclines.at50
1 files changed, 50 insertions, 0 deletions
diff --git a/tests/synclines.at b/tests/synclines.at
index 041ae194..63ae6858 100644
--- a/tests/synclines.at
+++ b/tests/synclines.at
@@ -216,4 +216,54 @@ exp: '0';
[input.y:8: #error "8"
])
+## -------------------- ##
+## %code top syncline. ##
+## -------------------- ##
+
+AT_TEST([%code top syncline],
+[[%code top {
+#error "2"
+}
+%{
+]AT_YYERROR_DECLARE_EXTERN[
+]AT_YYLEX_DECLARE_EXTERN[
+%}
+%%
+exp: '0';
+%%
+]],
+[input.y:2: #error "2"
+])
+
+m4_popdef([AT_TEST])
+
+## ----------- ##
+## %no-lines. ##
+## ----------- ##
+
+m4_pushdef([AT_TEST],
+[AT_SETUP([%no-lines])
+
+AT_BISON_OPTION_PUSHDEFS([%skeleton "$1" %defines])
+AT_DATA_GRAMMAR([input.y],
+[%skeleton "$1" %defines
+%{
+]AT_YYERROR_DECLARE_EXTERN[
+]AT_YYLEX_DECLARE_EXTERN[
+%}
+%%
+exp: '0'
+])
+AT_BISON_CHECK([--no-lines -o input.AT_SKEL_CC_IF([cc], [c]) -d input.y])
+AT_CHECK([[grep '#line' ]AT_SKEL_CC_IF([*.cc *.hh], [*.c *.h])], 1)
+AT_BISON_OPTION_POPDEFS
+
+AT_CLEANUP
+])
+
+AT_TEST([yacc.c])
+AT_TEST([glr.c])
+AT_TEST([lalr1.cc])
+AT_TEST([glr.cc])
+
m4_popdef([AT_TEST])