URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 384 |
/* Test for C99 declarations in for loops. */
|
/* Test for C99 declarations in for loops. */
|
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
|
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
|
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
extern void exit (int);
|
extern void exit (int);
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
int j = 0;
|
int j = 0;
|
int i = -1;
|
int i = -1;
|
for (int i = 1; i <= 10; i++)
|
for (int i = 1; i <= 10; i++)
|
j += i;
|
j += i;
|
if (j != 55)
|
if (j != 55)
|
abort ();
|
abort ();
|
if (i != -1)
|
if (i != -1)
|
abort ();
|
abort ();
|
j = 0;
|
j = 0;
|
for (auto int i = 1; i <= 10; i++)
|
for (auto int i = 1; i <= 10; i++)
|
j += i;
|
j += i;
|
if (j != 55)
|
if (j != 55)
|
abort ();
|
abort ();
|
if (i != -1)
|
if (i != -1)
|
abort ();
|
abort ();
|
j = 0;
|
j = 0;
|
for (register int i = 1; i <= 10; i++)
|
for (register int i = 1; i <= 10; i++)
|
j += i;
|
j += i;
|
if (j != 55)
|
if (j != 55)
|
abort ();
|
abort ();
|
if (i != -1)
|
if (i != -1)
|
abort ();
|
abort ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.