# [ADDITIONAL-TESTS])
# -----------------------------------------------------------------------------
m4_define([AT_CHECK_OUTPUT],
-[AT_SETUP([Output files: $2 $3 $5])
+[AT_SETUP([[Output files: $2 $3 $5]])
case "$1" in
*/*) mkdir `echo "$1" | sed 's,/.*,,'`;;
esac
[%skeleton "lalr1.cc" %defines], [--graph="location.hh"],
[foo.y: warning: conflicting outputs to file `location.hh'
])
+
+
+# AT_CHECK_OUTPUT_FILE_NAME(FILE-NAME-PREFIX, [ADDITIONAL-TESTS])
+# -----------------------------------------------------------------------------
+m4_define([AT_CHECK_OUTPUT_FILE_NAME],
+[AT_SETUP([Output file name: $1])
+
+AT_DATA([glr.y],
+[[%glr-parser
+%code {
+ int yylex (void);
+ void yyerror (const char *);
+}
+%%
+start: {};
+]])
+AT_CHECK([bison -o "AS_ESCAPE([$1.c])" --defines="AS_ESCAPE([$1.h])" glr.y])
+AT_CHECK([ls "AS_ESCAPE([$1.c])" "AS_ESCAPE([$1.h])"], [], [ignore])
+AT_COMPILE([glr.o], [-c "AS_ESCAPE([$1.c])"])
+$2
+
+AT_DATA([cxx.y],
+[[%skeleton "lalr1.cc"
+%code { int yylex (yy::parser::semantic_type*); }
+%%
+start: {};
+]])
+AT_CHECK([bison -o "AS_ESCAPE([$1.c])" --defines="AS_ESCAPE([$1.h])" cxx.y])
+AT_CHECK([ls "AS_ESCAPE([$1.c])" "AS_ESCAPE([$1.h])"], [], [ignore])
+AT_COMPILE_CXX([cxx.o], [-c "AS_ESCAPE([$1.c])"])
+$2
+
+AT_CLEANUP
+])
+
+# Notice that the header file name here cannot contain
+# `"' since FILENAME in `#include "FILENAME"' cannot.
+AT_CHECK_OUTPUT_FILE_NAME([[`~!@#$%^&*()-=_+{}[]|\:;<>, .']])
+AT_CHECK_OUTPUT_FILE_NAME([[(]])
+AT_CHECK_OUTPUT_FILE_NAME([[)]])
+AT_CHECK_OUTPUT_FILE_NAME([[#]])
+AT_CHECK_OUTPUT_FILE_NAME([[@@]])
+AT_CHECK_OUTPUT_FILE_NAME([[@{]])
+AT_CHECK_OUTPUT_FILE_NAME([[@}]])
+
+# Bison isn't M4-quoting file names before inserting them into muscles, so
+# these tests currently fail.
+AT_CHECK_OUTPUT_FILE_NAME([[@<:@]])
+AT_CHECK_OUTPUT_FILE_NAME([[@:>@]])