diff options
author | Ian Lance Taylor <iant@google.com> | 2007-11-28 18:01:06 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2007-11-28 18:01:06 +0000 |
commit | 79e052eafd9d4cf37eece125033771391b1e71b7 (patch) | |
tree | 636d425438707b6a193b0900334dbe4632949dd7 /gold/testsuite/Makefile.am | |
parent | f7bc09bdbcacf440e497242df536910f9f976346 (diff) | |
download | gdb-79e052eafd9d4cf37eece125033771391b1e71b7.zip gdb-79e052eafd9d4cf37eece125033771391b1e71b7.tar.gz gdb-79e052eafd9d4cf37eece125033771391b1e71b7.tar.bz2 |
From Craig Silverstein: Better handling of ODR violations which are
not in a function.
Diffstat (limited to 'gold/testsuite/Makefile.am')
-rw-r--r-- | gold/testsuite/Makefile.am | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index 622f4fc..1b0da6e 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -32,7 +32,8 @@ if NATIVE_LINKER TESTS += debug_msg.sh undef_symbol.sh -check_DATA += debug_msg.err undef_symbol.err +check_DATA += debug_msg.err debug_msg_so.err debug_msg_ndebug.err +check_DATA += undef_symbol.err NATIVE_PROGS = \ constructor_test \ @@ -133,11 +134,46 @@ debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@" @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \ then \ - echo 1>&2 "Link of debug_msg.o should have failed"; \ + echo 1>&2 "Link of debug_msg should have failed"; \ rm -f $@; \ exit 1; \ fi +# See if we can also detect problems when we're linking .so's, not .o's. +debug_msg.so: debug_msg.cc + $(CXXCOMPILE) -O0 -g -shared -w -o $@ $(srcdir)/debug_msg.cc +odr_violation1.so: odr_violation1.cc + $(CXXCOMPILE) -O0 -g -shared -w -o $@ $(srcdir)/odr_violation1.cc +odr_violation2.so: odr_violation2.cc + $(CXXCOMPILE) -O0 -g -shared -w -o $@ $(srcdir)/odr_violation2.cc +debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld + @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@" + @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \ + then \ + echo 1>&2 "Link of debug_msg_so should have failed"; \ + rm -f $@; \ + exit 1; \ + fi + + +# We also want to make sure we do something reasonable when there's no +# debug info available. For the best test, we use .so's. +debug_msg_ndebug.so: debug_msg.cc + $(CXXCOMPILE) -O0 -g0 -shared -w -o $@ $(srcdir)/debug_msg.cc +odr_violation1_ndebug.so: odr_violation1.cc + $(CXXCOMPILE) -O0 -g0 -shared -w -o $@ $(srcdir)/odr_violation1.cc +odr_violation2_ndebug.so: odr_violation2.cc + $(CXXCOMPILE) -O0 -g0 -shared -w -o $@ $(srcdir)/odr_violation2.cc +debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld + @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@" + @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \ + then \ + echo 1>&2 "Link of debug_msg_ndebug should have failed"; \ + rm -f $@; \ + exit 1; \ + fi + + undef_symbol.o: undef_symbol.cc $(CXXCOMPILE) -O0 -g -c -fPIC $< undef_symbol.so: undef_symbol.o |