Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / enum5.C
blobad40d4e1f9498a8c3baaab9ab3ee9264859f6897
1 // { dg-do run }
2 // Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
3 // Contributed by Ben Elliston <bje@redhat.com>
5 // PR 80: Packed enums use minimum required storage.
7 extern "C" void abort();
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;
13 int
14 main()
16   if (sizeof (nums) != 1)
17     abort ();
19   if (sizeof (cols) != 2)
20     abort ();
22   if (sizeof (forecast) != 1)
23     abort ();
25   return 0;