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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [static3.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
// { dg-do link }
2
// { dg-options "-O2" }
3
 
4
class Foo {
5
public:
6
  // No out-of-class definition is provided for these class members.
7
  // That's technically a violation of the standard, but no diagnostic
8
  // is required, and, as a QOI issue, we should optimize away all
9
  // references.
10
  static const int erf = 0;
11
  static const int foo = 1;
12
};
13
 
14
int one()
15
{
16
  return Foo::foo;
17
}
18
 
19
int two()
20
{
21
  return Foo::foo + Foo::erf;
22
}
23
 
24
int three(int x)
25
{
26
  return x ? Foo::erf : Foo::foo;
27
}
28
 
29
int i;
30
 
31
int main ()
32
{
33
  one ();
34
  two ();
35
  three (i);
36
}

powered by: WebSVN 2.1.0

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