From: ian Date: Sun, 27 Sep 2009 05:20:03 +0000 (+0000) Subject: * testsuite/initpri1.c: Don't try to use constructor priorities if X-Git-Tag: cgen-snapshot-20091101~496 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=206a25cffbca5ea1d7086feeec62b5d0eb295bf4;p=pf3gnuchains%2Fpf3gnuchains4x.git * testsuite/initpri1.c: Don't try to use constructor priorities if compiling with gcc before 4.3. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 81e4c6f8b7..8ca9b56a92 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2009-09-26 Ian Lance Taylor + + * testsuite/initpri1.c: Don't try to use constructor priorities if + compiling with gcc before 4.3. + 2009-09-22 Mikolaj Zalewski * testsuite/retain_symbols_file_test.sh (check_present): Change diff --git a/gold/testsuite/initpri1.c b/gold/testsuite/initpri1.c index 28c6c917d9..1c5252d873 100644 --- a/gold/testsuite/initpri1.c +++ b/gold/testsuite/initpri1.c @@ -1,6 +1,6 @@ /* initpri1.c -- test constructor priorities. - Copyright 2007, 2008 Free Software Foundation, Inc. + Copyright 2007, 2008, 2009 Free Software Foundation, Inc. Copied from the gcc testsuite, where the test was contributed by Mark Mitchell . @@ -19,14 +19,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, - MA 02110-1301, USA. + MA 02110-1301, USA. */ - This is a test of a common symbol in the main program and a - versioned symbol in a shared library. The common symbol in the - main program should override the shared library symbol. */ +/* This tests that the linker handles constructor and destructor + priorities correctly. */ #include +/* Constructor priorities in attributes were added in gcc 4.3. */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2) + int i; int j; @@ -93,3 +95,11 @@ int main (void) { abort (); return 0; } + +#else /* !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) */ + +int main (void) { + exit (0); +} + +#endif /* !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) */