mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-15 22:21:53 +08:00
enum5.C: New test.
2001-07-11 Ben Elliston <bje@redhat.com> * g++.old-deja/g++.other/enum5.C: New test. From-SVN: r43928
This commit is contained in:
parent
2df37a59e2
commit
6fbce318c3
@ -1,3 +1,7 @@
|
||||
2001-07-11 Ben Elliston <bje@redhat.com>
|
||||
|
||||
* g++.old-deja/g++.other/enum5.C: New test.
|
||||
|
||||
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
|
||||
* gcc.c-torture/compile/20010701-1.c,
|
||||
|
25
gcc/testsuite/g++.old-deja/g++.other/enum5.C
Normal file
25
gcc/testsuite/g++.old-deja/g++.other/enum5.C
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
// Contributed by Ben Elliston <bje@redhat.com>
|
||||
|
||||
// PR 80: Packed enums use minimum required storage.
|
||||
|
||||
extern "C" void abort();
|
||||
|
||||
enum numbers { one, two, three } __attribute__ ((packed)) nums;
|
||||
enum colours { red = 1000, green, blue } __attribute__ ((packed)) cols;
|
||||
enum __attribute__ ((packed)) conditions { fine, rain, cloudy } forecast;
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
if (sizeof (nums) != 1)
|
||||
abort ();
|
||||
|
||||
if (sizeof (cols) != 2)
|
||||
abort ();
|
||||
|
||||
if (sizeof (forecast) != 1)
|
||||
abort ();
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user