URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* Copyright (C) 2000 Free Software Foundation */
|
/* Copyright (C) 2000 Free Software Foundation */
|
/* by Alexandre Oliva <aoliva@redhat.com> */
|
/* by Alexandre Oliva <aoliva@redhat.com> */
|
|
|
enum foo { FOO, BAR };
|
enum foo { FOO, BAR };
|
|
|
/* Even though the underlying type of an enum is unspecified, the type
|
/* Even though the underlying type of an enum is unspecified, the type
|
of enumeration constants is explicitly defined as int (6.4.4.3/2 in
|
of enumeration constants is explicitly defined as int (6.4.4.3/2 in
|
the C99 Standard). Therefore, `i' must not be promoted to
|
the C99 Standard). Therefore, `i' must not be promoted to
|
`unsigned' in the comparison below; we must exit the loop when it
|
`unsigned' in the comparison below; we must exit the loop when it
|
becomes negative. */
|
becomes negative. */
|
|
|
int
|
int
|
main ()
|
main ()
|
{
|
{
|
int i;
|
int i;
|
for (i = BAR; i >= FOO; --i)
|
for (i = BAR; i >= FOO; --i)
|
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.