diff options
Diffstat (limited to 'binutils-2.25/gold/testsuite/odr_violation1.cc')
-rw-r--r-- | binutils-2.25/gold/testsuite/odr_violation1.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/binutils-2.25/gold/testsuite/odr_violation1.cc b/binutils-2.25/gold/testsuite/odr_violation1.cc new file mode 100644 index 00000000..8b37cea7 --- /dev/null +++ b/binutils-2.25/gold/testsuite/odr_violation1.cc @@ -0,0 +1,23 @@ +#include <algorithm> +#include "odr_header1.h" + +class Ordering { + public: + bool operator()(int a, int b) { + return a < b; + } +}; + +void SortAscending(int array[], int size) { + std::sort(array, array + size, Ordering()); +} + +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; +} |