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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [pr47392.c] - Rev 689

Compare with Previous | Blame | View Log

/* { dg-do run } */
/* { dg-options "-O2 -fdump-tree-pre-stats" } */
 
struct A
{
  int i;
};
 
struct B
{
  struct A a[2];
};
 
int i = 1;
struct B b = { 0, 3 };
 
void
test ()
{
  if (b.a[0].i != i)
    {
      int t = b.a[0].i;
      b.a[0] = b.a[1];
      b.a[1].i = t;
    }
 
  if (b.a[1].i == i)
    __builtin_abort ();
 
  if (b.a[0].i == 0)
    __builtin_abort ();
}
 
int
main ()
{
  test ();
  return 0;
}
 
/* { dg-final { scan-tree-dump "Eliminated: 1" "pre" } } */
/* { dg-final { cleanup-tree-dump "pre" } } */
 

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.