]> oss.titaniummirror.com Git - msp430-binutils.git/blobdiff - gold/testsuite/odr_violation2.cc
Imported binutils-2.20
[msp430-binutils.git] / gold / testsuite / odr_violation2.cc
diff --git a/gold/testsuite/odr_violation2.cc b/gold/testsuite/odr_violation2.cc
new file mode 100644 (file)
index 0000000..d569279
--- /dev/null
@@ -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());
+}