OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb79.C] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do assemble  }
2
// Makes bogus x86 assembly code.
3
#include 
4
 
5
// The VxWorks kernel-mode headers define a macro named "max", which is not
6
// ISO-compliant, but is part of the VxWorks API.
7
#if defined __vxworks && !defined __RTP__
8
#undef max
9
#endif
10
 
11
using namespace std;
12
 
13
template
14
T max(T a, T b)
15
{
16
  return (a > b) ? a : b;
17
}
18
 
19
// Prototypes (enable one or the other)
20
double max<>(double, double);      // { dg-error "" } bogus code
21
// int max(int, int);
22
 
23
int main()
24
{
25
  int i = 123;
26
  double d = 1234.5678;
27
 
28
  cout.precision(12);
29
  cout << max(d, i) << endl;  // { dg-error "" }
30
  cout << max(i, d) << endl;  // { dg-error "" }
31
  return 0;
32
}

powered by: WebSVN 2.1.0

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