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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [enum-2.c] - Blame information for rev 199

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

Line No. Rev Author Line
1 149 jeremybenn
/* Copyright (C) 2000 Free Software Foundation */
2
/* by Alexandre Oliva  <aoliva@redhat.com> */
3
 
4
enum foo { FOO, BAR };
5
 
6
/* Even though the underlying type of an enum is unspecified, the type
7
   of enumeration constants is explicitly defined as int (6.4.4.3/2 in
8
   the C99 Standard).  Therefore, `i' must not be promoted to
9
   `unsigned' in the comparison below; we must exit the loop when it
10
   becomes negative. */
11
 
12
int
13
main ()
14
{
15
  int i;
16
  for (i = BAR; i >= FOO; --i)
17
    if (i == -1)
18
      abort ();
19
 
20
  exit (0);
21
}
22
 

powered by: WebSVN 2.1.0

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