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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [pr43879-1_1.C] - Rev 693

Compare with Previous | Blame | View Log

/* { dg-do run } */
/* { dg-options "-fipa-pta" } */
/* { dg-additional-sources "pr43879-1_0.C" } */

struct A {
    int *i;
    A();
    ~A();
};

static inline int
aa(int *a, int *b)
{
  (void)b;
  return *a;
}

struct B {
    B() : i(0) {}
    int i;
    B(const A &a) : i(0)
    {
      f(*a.i);
    }
    void __attribute__((noinline, noclone))
        f(int j)
          {
            aa(&i, &j);
            i = 1;
          }
};

int
test()
{
  B b1;
  B b2 = B(A());
  b1 = B(A());
  if (b1.i != b2.i) __builtin_abort();
  return 0;
}

int
main()
{
  return test();
}

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.