From: Akim Demaille Date: Mon, 25 Aug 2008 11:43:00 +0000 (+0200) Subject: AT_FULL_COMPILE. X-Git-Tag: v2.7.90~1066 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/7ca2266adce5b0619068765b08e8ec5ca4673c1f AT_FULL_COMPILE. * tests/local.at (AT_FULL_COMPILE): New. * tests/actions.at, tests/calc.at, tests/regression.at: Use it. --- diff --git a/ChangeLog b/ChangeLog index e03a1043..d9a7b2e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-11 Akim Demaille + + AT_FULL_COMPILE. + * tests/local.at (AT_FULL_COMPILE): New. + * tests/actions.at, tests/calc.at, tests/regression.at: Use it. + 2008-11-11 Akim Demaille Support parens in calc++. diff --git a/tests/actions.at b/tests/actions.at index 602eac8c..afbc94db 100644 --- a/tests/actions.at +++ b/tests/actions.at @@ -1,5 +1,5 @@ # Executing Actions. -*- Autotest -*- -# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software # Foundation, Inc. # This program is free software: you can redistribute it and/or modify @@ -367,11 +367,7 @@ main (int argc, const char *argv[]) } ]]) -AT_LALR1_CC_IF( - [AT_BISON_CHECK([-o input.cc input.y]) - AT_COMPILE_CXX([input])], - [AT_BISON_CHECK([-o input.c input.y]) - AT_COMPILE([input])]) +AT_FULL_COMPILE([input]) # Check the location of "empty" diff --git a/tests/calc.at b/tests/calc.at index 03c8238f..8adf9e76 100644 --- a/tests/calc.at +++ b/tests/calc.at @@ -453,12 +453,7 @@ m4_ifval([$2], [AT_CHECK([exit 77])]) AT_BISON_OPTION_PUSHDEFS([$1]) AT_DATA_CALC_Y([$1]) - -AT_SKEL_CC_IF( - [AT_BISON_CHECK([-o calc.cc calc.y]) - AT_COMPILE_CXX([calc])], - [AT_BISON_CHECK([-o calc.c calc.y]) - AT_COMPILE([calc])]) +AT_FULL_COMPILE([calc]) # Test the priorities. _AT_CHECK_CALC([$1], diff --git a/tests/local.at b/tests/local.at index 59765c54..3b4f03b1 100644 --- a/tests/local.at +++ b/tests/local.at @@ -1,7 +1,7 @@ # Process this -*- Autotest -*- file with autom4te. # Macros for the GNU Bison Test suite. -# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 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 @@ -268,6 +268,18 @@ AT_CHECK([$CXX $CXXFLAGS $CPPFLAGS m4_bmatch([$1], [[.]], [], [$LDFLAGS ])-o $1 0, [ignore], [ignore])]) +# AT_FULL_COMPILE(OUTPUT) +# ----------------------- +# Compile OUTPUT.y to OUTPUT.c or OUTPUT.cc, and compile it to OUTPUT. +# Relies on AT_SKEL_CC_IF. +m4_define([AT_FULL_COMPILE], +[AT_SKEL_CC_IF( + [AT_BISON_CHECK([-o $1.cc $1.y]) + AT_COMPILE_CXX([$1])], + [AT_BISON_CHECK([-o $1.c $1.y]) + AT_COMPILE([$1])]) +]) + ## ---------------------------- ## ## Running a generated parser. ## diff --git a/tests/regression.at b/tests/regression.at index 6bfc8d09..fa2278a8 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -939,11 +939,7 @@ m4_define([AT_CHECK_DANCER], AT_BISON_OPTION_PUSHDEFS([$1]) _AT_DATA_DANCER_Y([$1]) AT_BISON_CHECK([-o dancer.c dancer.y]) -AT_LALR1_CC_IF( - [AT_BISON_CHECK([-o dancer.cc dancer.y]) - AT_COMPILE_CXX([dancer])], - [AT_BISON_CHECK([-o dancer.c dancer.y]) - AT_COMPILE([dancer])]) +AT_FULL_COMPILE([dancer]) AT_PARSER_CHECK([./dancer], 1, [], [syntax error, unexpected ':' ]) @@ -1039,11 +1035,7 @@ m4_define([AT_CHECK_EXPECT2], AT_BISON_OPTION_PUSHDEFS([$1]) _AT_DATA_EXPECT2_Y([$1]) AT_BISON_CHECK([-o expect2.c expect2.y]) -AT_LALR1_CC_IF( - [AT_BISON_CHECK([-o expect2.cc expect2.y]) - AT_COMPILE_CXX([expect2])], - [AT_BISON_CHECK([-o expect2.c expect2.y]) - AT_COMPILE([expect2])]) +AT_FULL_COMPILE([expect2]) AT_PARSER_CHECK([./expect2], 1, [], [syntax error, unexpected '+', expecting A or B ])