aboutsummaryrefslogtreecommitdiff
path: root/gold/testsuite/odr_violation2.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-14 01:03:01 +0000
committerIan Lance Taylor <iant@google.com>2007-11-14 01:03:01 +0000
commita55ce7febfaa52670ce3d9c236d3033de80ac091 (patch)
tree5955950569cfe09f083ba0e217a1a8085a844103 /gold/testsuite/odr_violation2.cc
parentb3c8c50a8f21a913e6c5dc91ff843cd4e924b01a (diff)
downloadgdb-a55ce7febfaa52670ce3d9c236d3033de80ac091.zip
gdb-a55ce7febfaa52670ce3d9c236d3033de80ac091.tar.gz
gdb-a55ce7febfaa52670ce3d9c236d3033de80ac091.tar.bz2
From Craig Silverstein: Rework debug info code a bit, add option for
ODR violations, add test case.
Diffstat (limited to 'gold/testsuite/odr_violation2.cc')
-rw-r--r--gold/testsuite/odr_violation2.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/gold/testsuite/odr_violation2.cc b/gold/testsuite/odr_violation2.cc
new file mode 100644
index 0000000..d569279
--- /dev/null
+++ b/gold/testsuite/odr_violation2.cc
@@ -0,0 +1,14 @@
+#include <algorithm>
+
+class Ordering {
+ public:
+ bool operator()(int a, int b) {
+ // We need the "+ 1" here to force this operator() to be a
+ // different size than the one in odr_violation1.cc.
+ return a + 1 > b + 1;
+ }
+};
+
+void SortDescending(int array[], int size) {
+ std::sort(array, array + size, Ordering());
+}