2 #include "odr_header1.h"
6 bool operator()(int a
, int b
) __attribute__((never_inline
));
9 // This comment makes the line numbers in Ordering::operator() all have
10 // two digits, which causes gold's output to be independent of which
11 // instruction the compiler optimizes into the front of the function.
12 bool Ordering::operator()(int a
, int b
) {
13 // Optimization makes this operator() a different size than the one
14 // in odr_violation1.cc.
15 return (a
* 30 + b
+ 12345) > b
/ 67;
18 void SortDescending(int array
[], int size
) {
19 std::sort(array
, array
+ size
, Ordering());
22 // This is weak in odr_violation1.cc.
23 extern "C" int OverriddenCFunction(int i
) {
27 // Extra lines to put SometimeInlineFunction at line 30+.
29 // And a dummy function to workaround a GCC 7 bug with debug line numbers.
30 int DummyFunction(int i
) {
34 // This is inline in debug_msg.cc, which makes it a weak symbol too.
35 int SometimesInlineFunction(int i
) {
39 // Instantiate the Derived vtable, with optimization (see Makefile.am).
40 OdrBase
* CreateOdrDerived2() {
41 return new OdrDerived
;