-# Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation,
-# Inc.
+
+# Copyright (C) 2001-2002, 2004-2007, 2009-2012 Free Software
+# Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Create FILE-NAME, containing a self checking parser for a huge
# triangular grammar.
m4_define([AT_DATA_TRIANGULAR_GRAMMAR],
# Create FILE-NAME, containing a self checking parser for a huge
# triangular grammar.
m4_define([AT_DATA_TRIANGULAR_GRAMMAR],
- exp { if (\@S|@1 != 0) abort (); \$\$ = \@S|@1; }
-| input exp { if (\@S|@2 != \@S|@1 + 1) abort (); \$\$ = \@S|@2; }
+ exp { assert (\@S|@1 == 0); \$\$ = \@S|@1; }
+| input exp { assert (\@S|@2 == \@S|@1 + 1); \$\$ = \@S|@2; }
# With 500 and the new parser, which consume far too much memory,
# it gets killed too. Of course the parser is to be cleaned.
AT_DATA_TRIANGULAR_GRAMMAR([input.y], [200])
# With 500 and the new parser, which consume far too much memory,
# it gets killed too. Of course the parser is to be cleaned.
AT_DATA_TRIANGULAR_GRAMMAR([input.y], [200])
# Create FILE-NAME, containing a self checking parser for a huge
# horizontal grammar.
m4_define([AT_DATA_HORIZONTAL_GRAMMAR],
# Create FILE-NAME, containing a self checking parser for a huge
# horizontal grammar.
m4_define([AT_DATA_HORIZONTAL_GRAMMAR],
# Ask for 200 MiB, which should be plenty even on a 64-bit host.
AT_INCREASE_DATA_SIZE(204000)
# Ask for 200 MiB, which should be plenty even on a 64-bit host.
AT_INCREASE_DATA_SIZE(204000)
# Create FILE-NAME, containing a self checking parser for a grammar
# requiring SIZE lookahead tokens.
m4_define([AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR],
# Create FILE-NAME, containing a self checking parser for a grammar
# requiring SIZE lookahead tokens.
m4_define([AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR],
# Ask for 200 MiB, which should be plenty even on a 64-bit host.
AT_INCREASE_DATA_SIZE(204000)
# Ask for 200 MiB, which should be plenty even on a 64-bit host.
AT_INCREASE_DATA_SIZE(204000)
# ------------------------------------------------
# A parser specialized in torturing the stack size.
m4_define([AT_DATA_STACK_TORTURE],
# ------------------------------------------------
# A parser specialized in torturing the stack size.
m4_define([AT_DATA_STACK_TORTURE],
- if (! (argv[1] != endp
- && 0 <= yylval_init && yylval_init <= INT_MAX
- && errno != ERANGE))
- abort ();
+ assert (argv[1] != endp);
+ assert (0 <= yylval_init);
+ assert (yylval_init <= INT_MAX);
+ assert (errno != ERANGE);
# just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect
# push parsers.
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
# just helps guarantee we don't let the YYSTACK_USE_ALLOCA feature affect
# push parsers.
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
]])
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
]])
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
AT_DATA_STACK_TORTURE([AT_USE_ALLOCA],
]])
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])
]])
AT_PARSER_CHECK([./input 20], 0, [], [ignore],
[[VALGRIND_OPTS="$VALGRIND_OPTS --log-fd=1"]])