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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [pr50763-4.C] - Blame information for rev 716

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O2 -ftree-tail-merge" } */
3
 
4
float
5
clamp (const float x)
6
{
7
  return x <= 1 ? 1 : x;
8
}
9
 
10
template < class T > struct VECTOR
11
{
12
  float x;
13
};
14
template < class TV > class JOINT
15
{
16
  virtual void Constrain_Angles (VECTOR < float >&angles) const;
17
};
18
 
19
template < class TV > class ANGLE_JOINT:public JOINT < TV >
20
{
21
  virtual ~ ANGLE_JOINT ()
22
  {
23
  }
24
  void Constrain_Angles (VECTOR < float >&angles) const
25
  {
26
    VECTOR < float >v;
27
    if (v.x)
28
        v.x = clamp (angles.x);
29
    else
30
        v.x = angles.x;
31
      angles.x = v.x;
32
  }
33
};
34
template ANGLE_JOINT < int >::~ANGLE_JOINT ();

powered by: WebSVN 2.1.0

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