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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [enum1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-std=gnu89" } */
3
 
4
/* In standard C, enumeration constants always have type int.  If they
5
   are not representables are int, they're ill-formed.  In GNU C, we
6
   give such ill-formed constructs well-defined meaning.  Make sure it
7
   works.  */
8
 
9
#include <stdlib.h>
10
 
11
enum foo
12
{
13
  foo1   = 0,
14
  foo2   = 0xffffffffffffffffULL,
15
  foo3   = 0xf0fffffffffffffeULL
16
};
17
 
18
int main ()
19
{
20
  if (sizeof (enum foo) != sizeof (unsigned long long))
21
    abort ();
22
  exit (0);
23
}

powered by: WebSVN 2.1.0

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