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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [ipa/] [ipa-pta-14.c] - Rev 706

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

/* { dg-do run } */
/* { dg-options "-O2 -fipa-pta -fno-tree-fre -fno-tree-sra -fdump-ipa-pta-details" } */
 
struct X {
    int i;
    void *p;
};
 
static void * __attribute__((noinline,noclone))
foo(struct X *q, void *p)
{
  struct X b;
  b.p = p;
  *q = b;
  return q->p;
}
extern void abort (void);
int main()
{
  struct X a, c;
  void *p;
  a.p = (void *)&c;
  p = foo(&a, &a);
  /* { dg-final { scan-ipa-dump "foo.result = { NULL a\[^ \]* c\[^ \]* }" "pta" { xfail *-*-* } } } */
  /* { dg-final { scan-ipa-dump "foo.result = { NULL a\[^ \]* a\[^ \]* c\[^ \]* }" "pta" } } */
  ((struct X *)p)->p = (void *)0;
  if (a.p != (void *)0)
    abort ();
  return 0;
}
 
/* { dg-final { cleanup-ipa-dump "pta" } } */
 

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.