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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [other/] [default4.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/15759
2
// Origin:   Lars Rune Nøstdal  
3
// Testcase: Volker Reichelt    
4
 
5
// { dg-do run }
6
 
7
extern "C" void abort();
8
 
9
int n = 0;
10
 
11
int f() { return ++n; }
12
 
13
int(&foo1)() = f;
14
int(*foo2)() = &f;
15
int(*foo3)() = f;
16
 
17
int bar1(int i = foo1()) { return i; }
18
int bar2(int i = foo2()) { return i; }
19
int bar3(int i = foo3()) { return i; }
20
int bar4(int i = f())    { return i; }
21
 
22
int main()
23
{
24
  if (bar1() != 1) abort();
25
  if (bar2() != 2) abort();
26
  if (bar3() != 3) abort();
27
  if (bar4() != 4) abort();
28
  return 0;
29
}

powered by: WebSVN 2.1.0

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