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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.robertl/] [eb79.C] - Blame information for rev 818

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

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

powered by: WebSVN 2.1.0

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