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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.pt/] [explicit54.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do run  }
2
extern "C" void abort ();
3
 
4
template  inline int fact2 ();
5
 
6
template  inline int fact ()
7
{
8
  return a * fact2 ();
9
}
10
 
11
template <> inline int fact<1> ()
12
{
13
  return 1;
14
}
15
 
16
template  inline int fact2 ()
17
{
18
  return a*fact();
19
}
20
 
21
template <> inline int fact2<1> ()
22
{
23
  return 1;
24
}
25
 
26
int main()
27
{
28
  if (fact<3> () != 6 || fact<1> () != 1
29
      || fact<3> () != 6 || fact<1> () != 1 || fact<1+0> () != 1)
30
    abort ();
31
  if (fact2<3> () != 6 || fact2<1> () != 1
32
      || fact2<3> () != 6 || fact2<1> () != 1 || fact2<1+0> () != 1)
33
    abort ();
34
  if (fact2<4> () != 24 || fact<4> () != 24)
35
    abort ();
36
}

powered by: WebSVN 2.1.0

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