diff options
author | Ian Lance Taylor <ian@airs.com> | 2011-03-11 21:42:12 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2011-03-11 21:42:12 +0000 |
commit | ed16fd1b1cafa7dcaf68ee6b1759bab1a25c270e (patch) | |
tree | 074cacf6bc585247cb79e7db7f770c827b13db98 /gold | |
parent | 4c2d572468f9adde02d19abeda30ce76390cbaad (diff) | |
download | gdb-ed16fd1b1cafa7dcaf68ee6b1759bab1a25c270e.zip gdb-ed16fd1b1cafa7dcaf68ee6b1759bab1a25c270e.tar.gz gdb-ed16fd1b1cafa7dcaf68ee6b1759bab1a25c270e.tar.bz2 |
PR gold/12572
* testsuite/odr_violation2.cc: Add comment to make all error line
numbers double digits.
* testsuite/debug_msg.sh: Adjust expected errors.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 7 | ||||
-rwxr-xr-x | gold/testsuite/debug_msg.sh | 12 | ||||
-rw-r--r-- | gold/testsuite/odr_violation2.cc | 7 |
3 files changed, 18 insertions, 8 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 77c2870..986f16e 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,10 @@ +2011-03-11 Jeffrey Yasskin <jyasskin@google.com> + + PR gold/12572 + * testsuite/odr_violation2.cc: Add comment to make all error line + numbers double digits. + * testsuite/debug_msg.sh: Adjust expected errors. + 2011-03-09 Jeffrey Yasskin <jyasskin@google.com> * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines, diff --git a/gold/testsuite/debug_msg.sh b/gold/testsuite/debug_msg.sh index b8624e7..0c89124 100755 --- a/gold/testsuite/debug_msg.sh +++ b/gold/testsuite/debug_msg.sh @@ -74,7 +74,7 @@ check debug_msg.err "debug_msg.o: in function int testfn<double>(double):.*/debu # Check we detected the ODR (One Definition Rule) violation. check debug_msg.err ": symbol 'Ordering::operator()(int, int)' defined in multiple places (possible ODR violation):" check debug_msg.err "odr_violation1.cc:6" -check debug_msg.err "odr_violation2.cc:9" +check debug_msg.err "odr_violation2.cc:12" # Check we don't have ODR false positives: check_missing debug_msg.err "OdrDerived::~OdrDerived()" @@ -85,10 +85,10 @@ check_missing debug_msg.err "__adjust_heap" # unintentional. check_missing debug_msg.err ": symbol 'OverriddenCFunction' defined in multiple places (possible ODR violation):" check_missing debug_msg.err "odr_violation1.cc:16" -check_missing debug_msg.err "odr_violation2.cc:20" +check_missing debug_msg.err "odr_violation2.cc:23" check debug_msg.err ": symbol 'SometimesInlineFunction(int)' defined in multiple places (possible ODR violation):" check debug_msg.err "debug_msg.cc:68" -check debug_msg.err "odr_violation2.cc:24" +check debug_msg.err "odr_violation2.cc:27" # When linking together .so's, we don't catch the line numbers, but we # still find all the undefined variables, and the ODR violation. @@ -97,15 +97,15 @@ check debug_msg_so.err "debug_msg.so: error: undefined reference to 'undef_fn2() check debug_msg_so.err "debug_msg.so: error: undefined reference to 'undef_int'" check debug_msg_so.err ": symbol 'Ordering::operator()(int, int)' defined in multiple places (possible ODR violation):" check debug_msg_so.err "odr_violation1.cc:6" -check debug_msg_so.err "odr_violation2.cc:9" +check debug_msg_so.err "odr_violation2.cc:12" check_missing debug_msg.err "OdrDerived::~OdrDerived()" check_missing debug_msg.err "__adjust_heap" check_missing debug_msg.err ": symbol 'OverriddenCFunction' defined in multiple places (possible ODR violation):" check_missing debug_msg.err "odr_violation1.cc:16" -check_missing debug_msg.err "odr_violation2.cc:20" +check_missing debug_msg.err "odr_violation2.cc:23" check debug_msg.err ": symbol 'SometimesInlineFunction(int)' defined in multiple places (possible ODR violation):" check debug_msg.err "debug_msg.cc:68" -check debug_msg.err "odr_violation2.cc:24" +check debug_msg.err "odr_violation2.cc:27" # These messages shouldn't need any debug info to detect: check debug_msg_ndebug.err "debug_msg_ndebug.so: error: undefined reference to 'undef_fn1()'" diff --git a/gold/testsuite/odr_violation2.cc b/gold/testsuite/odr_violation2.cc index 6c57b6f..a159182 100644 --- a/gold/testsuite/odr_violation2.cc +++ b/gold/testsuite/odr_violation2.cc @@ -6,11 +6,14 @@ class Ordering { bool operator()(int a, int b) __attribute__((never_inline)); }; +// This comment makes the line numbers in Ordering::operator() all have +// two digits, which causes gold's output to be independent of which +// instruction the compiler optimizes into the front of the function. bool Ordering::operator()(int a, int b) { // Optimization makes this operator() a different size than the one // in odr_violation1.cc. - return a + 1 > b + 1; - } + return a + 1 > b + 1; +} void SortDescending(int array[], int size) { std::sort(array, array + size, Ordering()); |