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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [tree-ssa/] [pr14703.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -fdump-tree-optimized -fno-ipa-reference" } */
3
#include 
4
 
5
namespace {
6
template  class fib {
7
 public:
8
   static const unsigned long long value = fib::value + fib::value;
9
};
10
 
11
template <> class fib<0> {
12
 public:
13
   static const unsigned long long value = 1;
14
};
15
 
16
template <> class fib<1> {
17
 public:
18
   static const unsigned long long value = 1;
19
};
20
 
21
template inline unsigned long long fibconst()
22
{
23
   return fibconst() + fibconst();
24
}
25
 
26
template <> inline unsigned long long fibconst<0>()
27
{
28
   return 1ull;
29
}
30
 
31
template <> inline unsigned long long fibconst<1>()
32
{
33
   return 1ull;
34
}
35
 
36
template <> inline unsigned long long fibconst<2>()
37
{
38
   return 2ull;
39
}
40
 
41
}
42
 
43
int main()
44
{
45
   ::std::cerr << "fib<90>::value == " << fib<90>::value << "\n";
46
   ::std::cerr << "fibcst<90>() == " << fibconst<90>() << "\n";
47
}
48
// { dg-final { scan-tree-dump-not "fibconst" "optimized" } }
49
// { dg-final { cleanup-tree-dump "optimized" } }

powered by: WebSVN 2.1.0

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