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] - Rev 821

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

/* { dg-do compile } */
/* { dg-options "-O2 -ftree-tail-merge" } */

float
clamp (const float x)
{
  return x <= 1 ? 1 : x;
}

template < class T > struct VECTOR
{
  float x;
};
template < class TV > class JOINT
{
  virtual void Constrain_Angles (VECTOR < float >&angles) const;
};

template < class TV > class ANGLE_JOINT:public JOINT < TV >
{
  virtual ~ ANGLE_JOINT ()
  {
  }
  void Constrain_Angles (VECTOR < float >&angles) const
  {
    VECTOR < float >v;
    if (v.x)
        v.x = clamp (angles.x);
    else
        v.x = angles.x;
      angles.x = v.x;
  }
};
template ANGLE_JOINT < int >::~ANGLE_JOINT ();

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

powered by: WebSVN 2.1.0

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