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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [vla-12.c] - Diff between revs 298 and 338

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

Rev 298 Rev 338
/* Test for typeof evaluation: should be at the appropriate point in
/* Test for typeof evaluation: should be at the appropriate point in
   the containing expression rather than just adding a statement.  */
   the containing expression rather than just adding a statement.  */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do run } */
/* { dg-do run } */
/* { dg-options "-std=gnu99" } */
/* { dg-options "-std=gnu99" } */
 
 
extern void exit (int);
extern void exit (int);
extern void abort (void);
extern void abort (void);
 
 
void *p;
void *p;
 
 
void
void
f1 (void)
f1 (void)
{
{
  int i = 0, j = -1, k = -1;
  int i = 0, j = -1, k = -1;
  /* typeof applied to expression with cast.  */
  /* typeof applied to expression with cast.  */
  (j = ++i), (void)(typeof ((int (*)[(k = ++i)])p))p;
  (j = ++i), (void)(typeof ((int (*)[(k = ++i)])p))p;
  if (j != 1 || k != 2 || i != 2)
  if (j != 1 || k != 2 || i != 2)
    abort ();
    abort ();
}
}
 
 
void
void
f2 (void)
f2 (void)
{
{
  int i = 0, j = -1, k = -1;
  int i = 0, j = -1, k = -1;
  /* typeof applied to type.  */
  /* typeof applied to type.  */
  (j = ++i), (void)(typeof (int (*)[(k = ++i)]))p;
  (j = ++i), (void)(typeof (int (*)[(k = ++i)]))p;
  if (j != 1 || k != 2 || i != 2)
  if (j != 1 || k != 2 || i != 2)
    abort ();
    abort ();
}
}
 
 
void
void
f3 (void)
f3 (void)
{
{
  int i = 0, j = -1, k = -1;
  int i = 0, j = -1, k = -1;
  void *q;
  void *q;
  /* typeof applied to expression with cast that is used.  */
  /* typeof applied to expression with cast that is used.  */
  (j = ++i), (void)((typeof (1 + (int (*)[(k = ++i)])p))p);
  (j = ++i), (void)((typeof (1 + (int (*)[(k = ++i)])p))p);
  if (j != 1 || k != 2 || i != 2)
  if (j != 1 || k != 2 || i != 2)
    abort ();
    abort ();
}
}
 
 
int
int
main (void)
main (void)
{
{
  f1 ();
  f1 ();
  f2 ();
  f2 ();
  f3 ();
  f3 ();
  exit (0);
  exit (0);
}
}
 
 

powered by: WebSVN 2.1.0

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