OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.dg/] [tree-ssa/] [pr33604.C] - Diff between revs 301 and 384

Only display areas with differences | Details | Blame | View Log

Rev 301 Rev 384
/* { dg-do run } */
/* { dg-do run } */
/* { dg-options "-O -fdump-tree-forwprop1" } */
/* { dg-options "-O -fdump-tree-forwprop1" } */
struct Value
struct Value
{
{
  double value;
  double value;
  Value(double value_) : value (value_) {}
  Value(double value_) : value (value_) {}
  operator double() const { return value; }
  operator double() const { return value; }
  Value& operator=(double other) { value = other; }
  Value& operator=(double other) { value = other; }
};
};
struct Ref
struct Ref
{
{
  const Value& m;
  const Value& m;
  Ref(const Value& m_) : m(m_) {}
  Ref(const Value& m_) : m(m_) {}
  operator double() const { return m; }
  operator double() const { return m; }
};
};
struct Diff
struct Diff
{
{
  const Ref lhs, rhs;
  const Ref lhs, rhs;
  Diff(const Value& lhs_, const Value& rhs_) : lhs(lhs_), rhs(rhs_) {}
  Diff(const Value& lhs_, const Value& rhs_) : lhs(lhs_), rhs(rhs_) {}
  operator double() const { return lhs - rhs; }
  operator double() const { return lhs - rhs; }
};
};
extern "C" void abort (void);
extern "C" void abort (void);
int main(int argc, char *argv[])
int main(int argc, char *argv[])
{
{
  Value I(1), m(4);
  Value I(1), m(4);
  for(int a = 0; a < 1000; a++)
  for(int a = 0; a < 1000; a++)
    m = Diff (I, m);
    m = Diff (I, m);
  if (!(m / 4 == I))
  if (!(m / 4 == I))
    abort ();
    abort ();
  return 0;
  return 0;
}
}
/* Check that we forward propagated
/* Check that we forward propagated
     D.2182_13 = (struct Ref *) &D.2137.lhs;
     D.2182_13 = (struct Ref *) &D.2137.lhs;
   to
   to
     D.2182_13->lhs.m ={v} &I;
     D.2182_13->lhs.m ={v} &I;
   yielding
   yielding
     D.2137.lhs.m ={v} &I;  */
     D.2137.lhs.m ={v} &I;  */
/* { dg-final { scan-tree-dump-times "D\\\.....\\\..hs\\\.m =" 2 "forwprop1" } } */
/* { dg-final { scan-tree-dump-times "D\\\.....\\\..hs\\\.m =" 2 "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
/* { dg-final { cleanup-tree-dump "forwprop1" } } */
 
 

powered by: WebSVN 2.1.0

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