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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20060929-1.c] - Rev 149

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

/* PR c/29154 */
 
extern void abort (void);
 
void
foo (int **p, int *q)
{
  *(*p++)++ = *q++;
}
 
void
bar (int **p, int *q)
{
  **p = *q++;
  *(*p++)++;
}
 
void
baz (int **p, int *q)
{
  **p = *q++;
  (*p++)++;
}
 
int
main (void)
{
  int i = 42, j = 0;
  int *p = &i;
  foo (&p, &j);
  if (p - 1 != &i || j != 0 || i != 0)
    abort ();
  i = 43;
  p = &i;
  bar (&p, &j);
  if (p - 1 != &i || j != 0 || i != 0)
    abort ();
  i = 44;
  p = &i;
  baz (&p, &j);
  if (p - 1 != &i || j != 0 || i != 0)
    abort ();
  return 0;
}
 

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.