1 # Bison Regressions. -*- Autotest -*-
2 # Copyright 2001 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19 AT_BANNER([[Regression tests.]])
21 ## ------------------ ##
22 ## Duplicate string. ##
23 ## ------------------ ##
26 AT_SETUP([Duplicate string])
28 AT_DATA([duplicate.y],
29 [[/* `Bison -v' used to dump core when two tokens are defined with the same
30 string, as LE and GE below. */
37 exp: '(' exp ')' | NUM ;
41 AT_CHECK([bison -v duplicate.y -o duplicate.c], 0, ignore, ignore)
43 AT_CLEANUP([duplicate.*])
47 ## ---------------------- ##
48 ## %union and --defines. ##
49 ## ---------------------- ##
52 AT_SETUP([%union and --defines])
64 AT_CHECK([bison --defines union.y])
69 ## --------------------------------------- ##
70 ## Duplicate '/' in C comments in %union ##
71 ## --------------------------------------- ##
74 AT_SETUP([%union and C comments])
76 AT_DATA([union-comment.y],
79 /* The int. */ int integer;
80 /* The string. */ char *string ;
86 AT_CHECK([bison union-comment.y])
87 AT_CHECK([fgrep '//*' union-comment.tab.c], [1], [])
89 AT_CLEANUP([union-comment.*])
97 AT_SETUP([Invalid input])
104 AT_CHECK([bison input.y], [1], [],
105 [input.y:2: invalid input: `?'
106 input.y:3: fatal error: no rules in the input grammar
112 ## --------------------- ##
113 ## Invalid CPP headers. ##
114 ## --------------------- ##
116 AT_SETUP([Invalid CPP headers])
120 AT_DATA([input/input.y],
125 AT_CHECK([bison --defines input/input.y])
127 AT_CHECK([sed 1q input/input.tab.h], 0,
128 [[#ifndef INPUT_INPUT_TAB_H