enum5.C: New test.
authorBen Elliston <bje@redhat.com>
Wed, 11 Jul 2001 07:51:07 +0000 (07:51 +0000)
committerBen Elliston <bje@gcc.gnu.org>
Wed, 11 Jul 2001 07:51:07 +0000 (17:51 +1000)
2001-07-11  Ben Elliston  <bje@redhat.com>

* g++.old-deja/g++.other/enum5.C: New test.

From-SVN: r43928

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/enum5.C [new file with mode: 0644]

index c9fb89f4bb0d9b9c0b7a10c543ede99650a87074..5dfb7eaa2972563683ed42c4ea55869918dcd1cd 100644 (file)
@@ -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 (file)
index 0000000..3b54b23
--- /dev/null
@@ -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;
+}