OpenCores
URL https://opencores.org/ocsvn/open8_urisc/open8_urisc/trunk

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [gold/] [testsuite/] [odr_violation2.cc] - Blame information for rev 27

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 khays
#include <algorithm>
2
#include "odr_header1.h"
3
 
4
class Ordering {
5
 public:
6
  bool operator()(int a, int b) __attribute__((never_inline));
7
};
8
 
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 + 1 > b + 1;
16
}
17
 
18
void SortDescending(int array[], int size) {
19
  std::sort(array, array + size, Ordering());
20
}
21
 
22
// This is weak in odr_violation1.cc.
23
extern "C" int OverriddenCFunction(int i) {
24
  return i * i;
25
}
26
// This is inline in debug_msg.cc, which makes it a weak symbol too.
27
int SometimesInlineFunction(int i) {
28
  return i * i;
29
}
30
 
31
// Instantiate the Derived vtable, with optimization (see Makefile.am).
32
OdrBase* CreateOdrDerived2() {
33
  return new OdrDerived;
34
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.