+
+#######################################################################
+
+AT_SETUP([Unresolved references])
+AT_DATA_GRAMMAR([test.y],
+[[
+%%
+stat:
+sym_a sym_b
+{ func($sym.field); }
+|
+sym_a sym_b
+{ func($<aa>sym.field); }
+|
+sym_a sym_b
+{ func($[sym.field]); }
+|
+sym_a sym_b
+{ func($<aa>[sym.field]); }
+|
+sym_a sym_b
+{ func($sym); }
+|
+sym_a sym_b
+{ func($<aa>sym); }
+|
+sym_a sym_b
+{ func($[sym]); }
+sym_a sym_b
+{ func($<aa>[sym]); }
+;
+stat1:
+sym_a sym_b
+{ func($sym-field); }
+|
+sym_a sym_b
+{ func($<aa>sym-field); }
+|
+sym_a sym_b
+{ func($[sym-field]); }
+|
+sym_a sym_b
+{ func($<aa>[sym-field]); }
+|
+sym_a sym_b
+{ func($sym); }
+|
+sym_a sym_b
+{ func($<aa>sym); }
+|
+sym_a sym_b
+{ func($[sym]); }
+sym_a sym_b
+{ func($<aa>[sym]); }
+;
+sym_a : 'a';
+sym_b : 'b';
+]])
+AT_BISON_CHECK([-o test.c test.y], 1, [],
+[[test.y:13.8-11: unresolved reference: `$sym'
+test.y:16.8-15: unresolved reference: `$<aa>sym'
+test.y:19.8-19: unresolved reference: `$[sym.field]'
+test.y:22.8-23: unresolved reference: `$<aa>[sym.field]'
+test.y:25.8-11: unresolved reference: `$sym'
+test.y:28.8-15: unresolved reference: `$<aa>sym'
+test.y:31.8-13: unresolved reference: `$[sym]'
+test.y:33.8-17: unresolved reference: `$<aa>[sym]'
+test.y:37.8-11: unresolved reference: `$sym'
+test.y:40.8-15: unresolved reference: `$<aa>sym'
+test.y:43.8-19: unresolved reference: `$[sym-field]'
+test.y:46.8-23: unresolved reference: `$<aa>[sym-field]'
+test.y:49.8-11: unresolved reference: `$sym'
+test.y:52.8-15: unresolved reference: `$<aa>sym'
+test.y:55.8-13: unresolved reference: `$[sym]'
+test.y:57.8-17: unresolved reference: `$<aa>[sym]'
+]])
+AT_CLEANUP