~ubuntu-branches/ubuntu/utopic/binutils-arm64-cross/utopic

« back to all changes in this revision

Viewing changes to binutils-2.23.52.20130611/gold/testsuite/odr_violation1.cc

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-06-20 17:38:09 UTC
  • Revision ID: package-import@ubuntu.com-20130620173809-app8lzgvymy5fg6c
Tags: 0.7
Build-depend on binutils-source (>= 2.23.52.20130620-1~).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <algorithm>
 
2
#include "odr_header1.h"
 
3
 
 
4
class Ordering {
 
5
 public:
 
6
  bool operator()(int a, int b) {
 
7
    return a < b;
 
8
  }
 
9
};
 
10
 
 
11
void SortAscending(int array[], int size) {
 
12
  std::sort(array, array + size, Ordering());
 
13
}
 
14
 
 
15
extern "C" int OverriddenCFunction(int i) __attribute__ ((weak));
 
16
extern "C" int OverriddenCFunction(int i) {
 
17
  return i;
 
18
}
 
19
 
 
20
// Instantiate the Derived vtable, without optimization.
 
21
OdrBase* CreateOdrDerived1() {
 
22
  return new OdrDerived;
 
23
}