* testsuite/initpri1.c: Don't try to use constructor priorities if

compiling with gcc before 4.3.
This commit is contained in:
Ian Lance Taylor
2009-09-27 05:20:03 +00:00
parent 5d40bb8544
commit a6a22b839b
2 changed files with 20 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2009-09-26 Ian Lance Taylor <iant@google.com>
* testsuite/initpri1.c: Don't try to use constructor priorities if
compiling with gcc before 4.3.
2009-09-22 Mikolaj Zalewski <mikolajz@google.com> 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
* testsuite/retain_symbols_file_test.sh (check_present): Change * testsuite/retain_symbols_file_test.sh (check_present): Change

View File

@ -1,6 +1,6 @@
/* initpri1.c -- test constructor priorities. /* 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 Copied from the gcc testsuite, where the test was contributed by
Mark Mitchell <mark@codesourcery.com>. Mark Mitchell <mark@codesourcery.com>.
@ -19,14 +19,16 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 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 /* This tests that the linker handles constructor and destructor
versioned symbol in a shared library. The common symbol in the priorities correctly. */
main program should override the shared library symbol. */
#include <stdlib.h> #include <stdlib.h>
/* Constructor priorities in attributes were added in gcc 4.3. */
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)
int i; int i;
int j; int j;
@ -93,3 +95,11 @@ int main (void) {
abort (); abort ();
return 0; return 0;
} }
#else /* !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) */
int main (void) {
exit (0);
}
#endif /* !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 2)) */