Debian Codegraph @

gcc/testsuite/g++.dg/ext/packed7.C

raw
1 // PR c++/14124
2 // A packed enum uses the minimal underlying type.
3
4 // Copyright (C) 2004 Free Software Foundation, Inc.
5 // Contributed by Matt Austern <[email protected]>
6
7 // { dg-do run }
8
9 enum XXX { xyzzy = 3 } __attribute__((packed));
10
11 int main()
12 {
13 int enumsize = sizeof(xyzzy);
14 return (enumsize == 1) ? 0 : 1;
15 }