summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-04-22 17:30:20 +0200
committerAkim Demaille <akim.demaille@gmail.com>2019-04-23 18:29:10 +0200
commita992a3cb9e5687a303ca3eba2b3f7afaea91ec5b (patch)
treecacf527414d193bbb3ca188bdb31184bc92be072 /tests
parent95d688957fccb504c7dc588be1bd72fe029b7460 (diff)
downloadbison-a992a3cb9e5687a303ca3eba2b3f7afaea91ec5b.tar.gz
diagnostics: don't try to quote special files
Based on a report by Todd Freed. http://lists.gnu.org/archive/html/bug-bison/2019-04/msg00000.html See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90034 * src/location.c (caret_info): Also track the file name. (location_caret): Don't quote special files.
Diffstat (limited to 'tests')
-rw-r--r--tests/diagnostics.at22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/diagnostics.at b/tests/diagnostics.at
index add313e0..8fc3aa66 100644
--- a/tests/diagnostics.at
+++ b/tests/diagnostics.at
@@ -161,5 +161,27 @@ input.y:18.4-17: <warning>warning:</warning> empty rule without %empty [<warning
]])
+## -------------- ##
+## Special files. ##
+## -------------- ##
+
+# Don't try to quote special files.
+# http://lists.gnu.org/archive/html/bug-bison/2019-04/msg00000.html
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90034
+
+AT_TEST([[Special files]],
+[[%%
+exp: a b
+a: {}
+#line 1 "/dev/stdout"
+b: {}
+]],
+[[input.y:11.4-5: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
+ 11 | a: <warning>{}</warning>
+ | <warning>^~</warning>
+/dev/stdout:1.4-5: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
+]])
+
+
m4_popdef([AT_TEST])