summaryrefslogtreecommitdiffstats
path: root/gold/testsuite/odr_violation1.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2011-03-10 01:31:33 +0000
committerIan Lance Taylor <ian@airs.com>2011-03-10 01:31:33 +0000
commit71ff89863ff23a581a1578755785e6b39dd209f2 (patch)
treeb5aab2587b661dc64d6117602ecb030274857c93 /gold/testsuite/odr_violation1.cc
parenta19fefdc57f5eafcb682175f2b2bcd8f6f366c90 (diff)
downloadppe42-binutils-71ff89863ff23a581a1578755785e6b39dd209f2.tar.gz
ppe42-binutils-71ff89863ff23a581a1578755785e6b39dd209f2.zip
* dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
but mark earlier ones as non-canonical (offset_to_iterator): Update search target and example (do_addr2line): Return extra lines in a vector* (format_file_lineno): Extract from do_addr2line (one_addr2line): Add vector* out-param * dwarf_reader.h (Offset_to_lineno_entry): New field recording when a lineno entry appeared last for its instruction (Dwarf_line_info): Add vector* out-param * object.cc (Relocate_info): Pass NULL for the vector* out-param * symtab.cc (Odr_violation_compare): Include the lineno in the comparison again. (linenos_from_loc): New. Combine the canonical line for an address with its other lines. (True_if_intersect): New. Helper functor to make std::set_intersection a query. (detect_odr_violations): Compare sets of lines instead of just one line for each function. This became less deterministic, but has fewer false positives. * symtab.h: Declarations. * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to mix an optimized and non-optimized object in the same binary (odr_violation2.so): Same. * testsuite/Makefile.in: Regenerate from Makefile.am. * testsuite/debug_msg.cc (main): Make OdrDerived classes. * testsuite/debug_msg.sh: Update line numbers and add assertions. * testsuite/odr_violation1.cc: Use OdrDerived, in a non-optimized context. * testsuite/odr_violation2.cc: Make sure Ordering::operator() isn't inlined, and use OdrDerived in an optimized context. * testsuite/odr_header1.h: Defines OdrDerived, where optimization will change the first-instruction-in-the-destructor's file and line number. * testsuite/odr_header2.h: Defines OdrBase.
Diffstat (limited to 'gold/testsuite/odr_violation1.cc')
-rw-r--r--gold/testsuite/odr_violation1.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gold/testsuite/odr_violation1.cc b/gold/testsuite/odr_violation1.cc
index 6c404964c1..8b37cea7e2 100644
--- a/gold/testsuite/odr_violation1.cc
+++ b/gold/testsuite/odr_violation1.cc
@@ -1,4 +1,5 @@
#include <algorithm>
+#include "odr_header1.h"
class Ordering {
public:
@@ -15,3 +16,8 @@ extern "C" int OverriddenCFunction(int i) __attribute__ ((weak));
extern "C" int OverriddenCFunction(int i) {
return i;
}
+
+// Instantiate the Derived vtable, without optimization.
+OdrBase* CreateOdrDerived1() {
+ return new OdrDerived;
+}
OpenPOWER on IntegriCloud