2001-07-11 Ben Elliston <bje@redhat.com>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / enum5.C
blob3b54b2323e583acef52c00b1f924f0b877346631
1 // Copyright (C) 2001 Free Software Foundation, Inc.
2 // Contributed by Ben Elliston <bje@redhat.com>
4 // PR 80: Packed enums use minimum required storage.
6 extern "C" void abort();
8 enum numbers { one, two, three } __attribute__ ((packed)) nums;
9 enum colours { red = 1000, green, blue } __attribute__ ((packed)) cols;
10 enum __attribute__ ((packed)) conditions { fine, rain, cloudy } forecast;
12 int
13 main()
15   if (sizeof (nums) != 1)
16     abort ();
18   if (sizeof (cols) != 2)
19     abort ();
21   if (sizeof (forecast) != 1)
22     abort ();
24   return 0;