]> git.saurik.com Git - bison.git/blobdiff - tests/reduce.at
* src/reduce.c (reduce_grammar): When the language is empty,
[bison.git] / tests / reduce.at
index 7dc939ed399e4428911efeb30449c28cd37287fa..4c8da723898cc719bab2105918899cc9250b34db 100644 (file)
@@ -332,3 +332,24 @@ Useless rules
 ]])
 
 AT_CLEANUP
+
+
+
+## ---------------- ##
+## Empty Language.  ##
+## ---------------- ##
+
+AT_SETUP([Empty Language])
+
+AT_DATA([[input.y]],
+[[%output="input.c"
+%%
+exp: exp;
+]])
+
+AT_CHECK([[bison input.y]], 1, [],
+[[input.y: warning: 2 useless nonterminals and 2 useless rules
+input.y:3.1-3: fatal error: start symbol exp does not derive any sentence
+]])
+
+AT_CLEANUP