summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-11 07:51:07 +0000
committerbje <bje@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-11 07:51:07 +0000
commit186a6efe0608927dff52816dea7ad0af3dd1b759 (patch)
treef3852afefc0f7e6a9192d6c6429e76f894bc3c73 /gcc
parent43aae69417da2f3302e53644e37526fbebaa85d6 (diff)
downloadgcc-186a6efe0608927dff52816dea7ad0af3dd1b759.tar.gz
2001-07-11 Ben Elliston <bje@redhat.com>
* g++.old-deja/g++.other/enum5.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43928 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/enum5.C25
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c9fb89f4bb0..5dfb7eaa297 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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,
diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum5.C b/gcc/testsuite/g++.old-deja/g++.other/enum5.C
new file mode 100644
index 00000000000..3b54b2323e5
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/enum5.C
@@ -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;
+}