diff options
author | Ian Lance Taylor <iant@google.com> | 2007-09-26 05:44:38 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-09-26 05:44:38 +0000 |
commit | 3151305a47fc17a35bc76cc50578b3e8f9b93d9d (patch) | |
tree | 7579f01394de3af6a03a35d162ae8c59fefaf9a8 /gold/testsuite | |
parent | 4dffcebc10670489b064181a62e9588e72fb566a (diff) | |
download | gdb-3151305a47fc17a35bc76cc50578b3e8f9b93d9d.zip gdb-3151305a47fc17a35bc76cc50578b3e8f9b93d9d.tar.gz gdb-3151305a47fc17a35bc76cc50578b3e8f9b93d9d.tar.bz2 |
Add basic exception frame header, plus test.
Diffstat (limited to 'gold/testsuite')
-rw-r--r-- | gold/testsuite/Makefile.am | 65 | ||||
-rw-r--r-- | gold/testsuite/Makefile.in | 168 | ||||
-rw-r--r-- | gold/testsuite/exception_test.h | 27 | ||||
-rw-r--r-- | gold/testsuite/exception_test_1.cc | 52 | ||||
-rw-r--r-- | gold/testsuite/exception_test_2.cc | 31 | ||||
-rw-r--r-- | gold/testsuite/exception_test_main.cc | 35 |
6 files changed, 373 insertions, 5 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index 1ee388f..1663895 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -30,7 +30,14 @@ NATIVE_PROGS = \ two_file_shared_2_nonpic_test \ two_file_same_shared_nonpic_test \ two_file_separate_shared_12_nonpic_test \ - two_file_separate_shared_21_nonpic_test + two_file_separate_shared_21_nonpic_test \ + exception_test \ + exception_static_test \ + exception_shared_1_test \ + exception_shared_2_test \ + exception_same_shared_test \ + exception_separate_shared_12_test \ + exception_separate_shared_21_test NATIVE_TESTING = \ basic_test \ @@ -177,5 +184,61 @@ two_file_shared_2_nonpic.so: two_file_test_2.o two_file_shared_nonpic.so: two_file_test_1.o two_file_test_2.o $(CXXLINK) -shared two_file_test_1.o two_file_test_2.o +exception_test_SOURCES = \ + exception_test_main.cc \ + exception_test_1.cc \ + exception_test_2.cc \ + exception_test.h +exception_test_DEPENDENCIES = gcctestdir/ld +exception_test_LDFLAGS = -Bgcctestdir/ + +exception_static_test_SOURCES = \ + exception_test_main.cc \ + exception_test_1.cc \ + exception_test_2.cc +exception_static_test_DEPENDENCIES = gcctestdir/ld +exception_static_test_LDFLAGS = -Bgcctestdir/ -static + +exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc +exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so +exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +exception_shared_1_test_LDADD = exception_shared_1.so + +exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc +exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so +exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +exception_shared_2_test_LDADD = exception_shared_2.so + +exception_same_shared_test_SOURCES = exception_test_main.cc +exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so +exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +exception_same_shared_test_LDADD = exception_shared.so + +exception_separate_shared_12_test_SOURCES = exception_test_main.cc +exception_separate_shared_12_test_DEPENDENCIES = \ + gcctestdir/ld exception_shared_1.so exception_shared_2.so +exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +exception_separate_shared_12_test_LDADD = \ + exception_shared_1.so exception_shared_2.so + +exception_separate_shared_21_test_SOURCES = exception_test_main.cc +exception_separate_shared_21_test_DEPENDENCIES = \ + gcctestdir/ld exception_shared_1.so exception_shared_2.so +exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +exception_separate_shared_21_test_LDADD = \ + exception_shared_2.so exception_shared_1.so + +exception_test_1_pic.o: exception_test_1.cc + $(CXXCOMPILE) -c -fpic -o $@ $< +exception_test_2_pic.o: exception_test_2.cc + $(CXXCOMPILE) -c -fpic -o $@ $< + +exception_shared_1.so: exception_test_1_pic.o + $(CXXLINK) -shared exception_test_1_pic.o +exception_shared_2.so: exception_test_2_pic.o + $(CXXLINK) -shared exception_test_2_pic.o +exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o + $(CXXLINK) -shared exception_test_1_pic.o exception_test_2_pic.o + endif endif diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in index edf32e8..57ac16a 100644 --- a/gold/testsuite/Makefile.in +++ b/gold/testsuite/Makefile.in @@ -53,6 +53,13 @@ check_PROGRAMS = object_unittest$(EXEEXT) $(am__EXEEXT_1) @GCC_FALSE@two_file_test_DEPENDENCIES = libgoldtest.a ../libgold.a @NATIVE_LINKER_FALSE@two_file_test_DEPENDENCIES = libgoldtest.a \ @NATIVE_LINKER_FALSE@ ../libgold.a +@GCC_FALSE@exception_test_DEPENDENCIES = libgoldtest.a ../libgold.a +@NATIVE_LINKER_FALSE@exception_test_DEPENDENCIES = libgoldtest.a \ +@NATIVE_LINKER_FALSE@ ../libgold.a +@GCC_FALSE@exception_static_test_DEPENDENCIES = libgoldtest.a \ +@GCC_FALSE@ ../libgold.a +@NATIVE_LINKER_FALSE@exception_static_test_DEPENDENCIES = \ +@NATIVE_LINKER_FALSE@ libgoldtest.a ../libgold.a subdir = testsuite DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -87,7 +94,14 @@ libgoldtest_a_OBJECTS = $(am_libgoldtest_a_OBJECTS) @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_nonpic_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_nonpic_test$(EXEEXT) \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_12_nonpic_test$(EXEEXT) \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_nonpic_test$(EXEEXT) +@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_nonpic_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_static_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_1_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_2_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_same_shared_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_12_test$(EXEEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_21_test$(EXEEXT) am__constructor_static_test_SOURCES_DIST = constructor_test.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@am_constructor_static_test_OBJECTS = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_test.$(OBJEXT) @@ -99,6 +113,53 @@ am__constructor_test_SOURCES_DIST = constructor_test.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@ constructor_test.$(OBJEXT) constructor_test_OBJECTS = $(am_constructor_test_OBJECTS) constructor_test_LDADD = $(LDADD) +am__exception_same_shared_test_SOURCES_DIST = exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_same_shared_test_OBJECTS = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) +exception_same_shared_test_OBJECTS = \ + $(am_exception_same_shared_test_OBJECTS) +am__exception_separate_shared_12_test_SOURCES_DIST = \ + exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_separate_shared_12_test_OBJECTS = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) +exception_separate_shared_12_test_OBJECTS = \ + $(am_exception_separate_shared_12_test_OBJECTS) +am__exception_separate_shared_21_test_SOURCES_DIST = \ + exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_separate_shared_21_test_OBJECTS = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) +exception_separate_shared_21_test_OBJECTS = \ + $(am_exception_separate_shared_21_test_OBJECTS) +am__exception_shared_1_test_SOURCES_DIST = exception_test_2.cc \ + exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_shared_1_test_OBJECTS = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.$(OBJEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) +exception_shared_1_test_OBJECTS = \ + $(am_exception_shared_1_test_OBJECTS) +am__exception_shared_2_test_SOURCES_DIST = exception_test_1.cc \ + exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_shared_2_test_OBJECTS = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.$(OBJEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) +exception_shared_2_test_OBJECTS = \ + $(am_exception_shared_2_test_OBJECTS) +am__exception_static_test_SOURCES_DIST = exception_test_main.cc \ + exception_test_1.cc exception_test_2.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_static_test_OBJECTS = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.$(OBJEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.$(OBJEXT) +exception_static_test_OBJECTS = $(am_exception_static_test_OBJECTS) +exception_static_test_LDADD = $(LDADD) +am__exception_test_SOURCES_DIST = exception_test_main.cc \ + exception_test_1.cc exception_test_2.cc exception_test.h +@GCC_TRUE@@NATIVE_LINKER_TRUE@am_exception_test_OBJECTS = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.$(OBJEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.$(OBJEXT) \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.$(OBJEXT) +exception_test_OBJECTS = $(am_exception_test_OBJECTS) +exception_test_LDADD = $(LDADD) am_object_unittest_OBJECTS = object_unittest.$(OBJEXT) object_unittest_OBJECTS = $(am_object_unittest_OBJECTS) object_unittest_LDADD = $(LDADD) @@ -185,7 +246,14 @@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgoldtest_a_SOURCES) $(constructor_static_test_SOURCES) \ - $(constructor_test_SOURCES) $(object_unittest_SOURCES) \ + $(constructor_test_SOURCES) \ + $(exception_same_shared_test_SOURCES) \ + $(exception_separate_shared_12_test_SOURCES) \ + $(exception_separate_shared_21_test_SOURCES) \ + $(exception_shared_1_test_SOURCES) \ + $(exception_shared_2_test_SOURCES) \ + $(exception_static_test_SOURCES) $(exception_test_SOURCES) \ + $(object_unittest_SOURCES) \ $(two_file_same_shared_nonpic_test_SOURCES) \ $(two_file_same_shared_test_SOURCES) \ $(two_file_separate_shared_12_nonpic_test_SOURCES) \ @@ -199,7 +267,13 @@ SOURCES = $(libgoldtest_a_SOURCES) $(constructor_static_test_SOURCES) \ DIST_SOURCES = $(libgoldtest_a_SOURCES) \ $(am__constructor_static_test_SOURCES_DIST) \ $(am__constructor_test_SOURCES_DIST) \ - $(object_unittest_SOURCES) \ + $(am__exception_same_shared_test_SOURCES_DIST) \ + $(am__exception_separate_shared_12_test_SOURCES_DIST) \ + $(am__exception_separate_shared_21_test_SOURCES_DIST) \ + $(am__exception_shared_1_test_SOURCES_DIST) \ + $(am__exception_shared_2_test_SOURCES_DIST) \ + $(am__exception_static_test_SOURCES_DIST) \ + $(am__exception_test_SOURCES_DIST) $(object_unittest_SOURCES) \ $(am__two_file_same_shared_nonpic_test_SOURCES_DIST) \ $(am__two_file_same_shared_test_SOURCES_DIST) \ $(am__two_file_separate_shared_12_nonpic_test_SOURCES_DIST) \ @@ -354,7 +428,14 @@ INCLUDES = -D_GNU_SOURCE \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_nonpic_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_same_shared_nonpic_test \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_12_nonpic_test \ -@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_nonpic_test +@GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_separate_shared_21_nonpic_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_static_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_1_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_2_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_same_shared_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_12_test \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_separate_shared_21_test @GCC_TRUE@@NATIVE_LINKER_TRUE@NATIVE_TESTING = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ basic_test \ @@ -451,6 +532,49 @@ object_unittest_SOURCES = object_unittest.cc @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_separate_shared_21_nonpic_test_LDADD = \ @GCC_TRUE@@NATIVE_LINKER_TRUE@ two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_SOURCES = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.cc \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.cc \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.cc \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test.h + +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_DEPENDENCIES = gcctestdir/ld +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_LDFLAGS = -Bgcctestdir/ +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_static_test_SOURCES = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_main.cc \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_1.cc \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_test_2.cc + +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_static_test_DEPENDENCIES = gcctestdir/ld +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_static_test_LDFLAGS = -Bgcctestdir/ -static +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1_test_LDADD = exception_shared_1.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2_test_LDADD = exception_shared_2.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_same_shared_test_SOURCES = exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_same_shared_test_LDADD = exception_shared.so +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_SOURCES = exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_DEPENDENCIES = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld exception_shared_1.so exception_shared_2.so + +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_LDADD = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_1.so exception_shared_2.so + +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_SOURCES = exception_test_main.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_DEPENDENCIES = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ gcctestdir/ld exception_shared_1.so exception_shared_2.so + +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_LDADD = \ +@GCC_TRUE@@NATIVE_LINKER_TRUE@ exception_shared_2.so exception_shared_1.so + all: all-am .SUFFIXES: @@ -500,6 +624,27 @@ constructor_static_test$(EXEEXT): $(constructor_static_test_OBJECTS) $(construct constructor_test$(EXEEXT): $(constructor_test_OBJECTS) $(constructor_test_DEPENDENCIES) @rm -f constructor_test$(EXEEXT) $(CXXLINK) $(constructor_test_LDFLAGS) $(constructor_test_OBJECTS) $(constructor_test_LDADD) $(LIBS) +exception_same_shared_test$(EXEEXT): $(exception_same_shared_test_OBJECTS) $(exception_same_shared_test_DEPENDENCIES) + @rm -f exception_same_shared_test$(EXEEXT) + $(CXXLINK) $(exception_same_shared_test_LDFLAGS) $(exception_same_shared_test_OBJECTS) $(exception_same_shared_test_LDADD) $(LIBS) +exception_separate_shared_12_test$(EXEEXT): $(exception_separate_shared_12_test_OBJECTS) $(exception_separate_shared_12_test_DEPENDENCIES) + @rm -f exception_separate_shared_12_test$(EXEEXT) + $(CXXLINK) $(exception_separate_shared_12_test_LDFLAGS) $(exception_separate_shared_12_test_OBJECTS) $(exception_separate_shared_12_test_LDADD) $(LIBS) +exception_separate_shared_21_test$(EXEEXT): $(exception_separate_shared_21_test_OBJECTS) $(exception_separate_shared_21_test_DEPENDENCIES) + @rm -f exception_separate_shared_21_test$(EXEEXT) + $(CXXLINK) $(exception_separate_shared_21_test_LDFLAGS) $(exception_separate_shared_21_test_OBJECTS) $(exception_separate_shared_21_test_LDADD) $(LIBS) +exception_shared_1_test$(EXEEXT): $(exception_shared_1_test_OBJECTS) $(exception_shared_1_test_DEPENDENCIES) + @rm -f exception_shared_1_test$(EXEEXT) + $(CXXLINK) $(exception_shared_1_test_LDFLAGS) $(exception_shared_1_test_OBJECTS) $(exception_shared_1_test_LDADD) $(LIBS) +exception_shared_2_test$(EXEEXT): $(exception_shared_2_test_OBJECTS) $(exception_shared_2_test_DEPENDENCIES) + @rm -f exception_shared_2_test$(EXEEXT) + $(CXXLINK) $(exception_shared_2_test_LDFLAGS) $(exception_shared_2_test_OBJECTS) $(exception_shared_2_test_LDADD) $(LIBS) +exception_static_test$(EXEEXT): $(exception_static_test_OBJECTS) $(exception_static_test_DEPENDENCIES) + @rm -f exception_static_test$(EXEEXT) + $(CXXLINK) $(exception_static_test_LDFLAGS) $(exception_static_test_OBJECTS) $(exception_static_test_LDADD) $(LIBS) +exception_test$(EXEEXT): $(exception_test_OBJECTS) $(exception_test_DEPENDENCIES) + @rm -f exception_test$(EXEEXT) + $(CXXLINK) $(exception_test_LDFLAGS) $(exception_test_OBJECTS) $(exception_test_LDADD) $(LIBS) object_unittest$(EXEEXT): $(object_unittest_OBJECTS) $(object_unittest_DEPENDENCIES) @rm -f object_unittest$(EXEEXT) $(CXXLINK) $(object_unittest_LDFLAGS) $(object_unittest_OBJECTS) $(object_unittest_LDADD) $(LIBS) @@ -544,6 +689,9 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constructor_test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception_test_1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception_test_2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exception_test_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/object_unittest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testfile.Po@am__quote@ @@ -845,6 +993,18 @@ uninstall-am: uninstall-info-am @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -shared two_file_test_2.o @GCC_TRUE@@NATIVE_LINKER_TRUE@two_file_shared_nonpic.so: two_file_test_1.o two_file_test_2.o @GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -shared two_file_test_1.o two_file_test_2.o + +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_1_pic.o: exception_test_1.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $< +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_test_2_pic.o: exception_test_2.cc +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXCOMPILE) -c -fpic -o $@ $< + +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_1.so: exception_test_1_pic.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -shared exception_test_1_pic.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared_2.so: exception_test_2_pic.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -shared exception_test_2_pic.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o +@GCC_TRUE@@NATIVE_LINKER_TRUE@ $(CXXLINK) -shared exception_test_1_pic.o exception_test_2_pic.o # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/gold/testsuite/exception_test.h b/gold/testsuite/exception_test.h new file mode 100644 index 0000000..1f5c74f --- /dev/null +++ b/gold/testsuite/exception_test.h @@ -0,0 +1,27 @@ +// exception_test.h -- exception test case for gold, header file -*- C++ -*- + +// Copyright 2006, 2007 Free Software Foundation, Inc. +// Written by Ian Lance Taylor <iant@google.com>. + +// This file is part of gold. + +// 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 +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// 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. + +// This tests references between files. This is the shared header +// file. See exception_test_1.cc for details. + +extern bool t1(); +extern void f1(); diff --git a/gold/testsuite/exception_test_1.cc b/gold/testsuite/exception_test_1.cc new file mode 100644 index 0000000..faebce6 --- /dev/null +++ b/gold/testsuite/exception_test_1.cc @@ -0,0 +1,52 @@ +// exception_test_1.cc -- test exception handling for gold, file 1 of 2 + +// Copyright 2006, 2007 Free Software Foundation, Inc. +// Written by Ian Lance Taylor <iant@google.com>. + +// This file is part of gold. + +// 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 +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// 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. + +// This tests throwing an exception across various boundaries. This +// is a general test of the exception frame handling, and the +// interaction with the compiler support libraries. This is file 1, +// which catches the exception. We test in several different ways: + +// Files 1 and 2 linked together in executable. +// File 1 in executable, file 2 in shared library. +// File 1 in shared library, file 2 in executable. +// Files 1 and 2 linked together in shared library. +// Files 1 and 2 in different shared libraries. + +#include "exception_test.h" + +bool +t1() +{ + int i; + try + { + i = 0; + f1(); + i = 1; + } + catch (...) + { + return i == 0; + } + + return false; +} diff --git a/gold/testsuite/exception_test_2.cc b/gold/testsuite/exception_test_2.cc new file mode 100644 index 0000000..baced63 --- /dev/null +++ b/gold/testsuite/exception_test_2.cc @@ -0,0 +1,31 @@ +// exception_test_1.cc -- test exception handling for gold, file 1 of 2 + +// Copyright 2006, 2007 Free Software Foundation, Inc. +// Written by Ian Lance Taylor <iant@google.com>. + +// This file is part of gold. + +// 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 +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// 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. + +// Second part of exception test. See exception_test_1.cc for details. + +#include "exception_test.h" + +void +f1() +{ + throw 0; +} diff --git a/gold/testsuite/exception_test_main.cc b/gold/testsuite/exception_test_main.cc new file mode 100644 index 0000000..3976364 --- /dev/null +++ b/gold/testsuite/exception_test_main.cc @@ -0,0 +1,35 @@ +// exception_test_main.cc -- an exception test case for gold, main function + +// Copyright 2006, 2007 Free Software Foundation, Inc. +// Written by Ian Lance Taylor <iant@google.com>. + +// This file is part of gold. + +// 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 +// the Free Software Foundation; either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// 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. + +// This tests references between files. This is the main file. See +// two_file_test_1.cc for details. + +#include <cassert> + +#include "exception_test.h" + +int +main() +{ + assert(t1()); + return 0; +} |