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/] [g++.old-deja/] [g++.other/] [enum5.C] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do run }
2
// Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
3
// Contributed by Ben Elliston 
4
 
5
// PR 80: Packed enums use minimum required storage.
6
 
7
extern "C" void abort();
8
 
9
enum numbers { one, two, three } __attribute__ ((packed)) nums;
10
enum colours { red = 1000, green, blue } __attribute__ ((packed)) cols;
11
enum conditions { fine, rain, cloudy } __attribute__ ((packed)) forecast;
12
 
13
int
14
main()
15
{
16
  if (sizeof (nums) != 1)
17
    abort ();
18
 
19
  if (sizeof (cols) != 2)
20
    abort ();
21
 
22
  if (sizeof (forecast) != 1)
23
    abort ();
24
 
25
  return 0;
26
}

powered by: WebSVN 2.1.0

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