FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / enum5.C
blob8fb3c4d53926841d41613af46eb33f5446cf929a
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.
5 // excess errors test - XFAIL *-*-*
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 __attribute__ ((packed)) conditions { fine, rain, cloudy } 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;