symbian.h (CC1_SPEC): Add -fno-short-enums.
authorMark Mitchell <mark@codesourcery.com>
Fri, 6 Aug 2004 07:54:19 +0000 (07:54 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 6 Aug 2004 07:54:19 +0000 (07:54 +0000)
* config/arm/symbian.h (CC1_SPEC): Add -fno-short-enums.
(CC1PLUS_SPEC): Define it to be the same as CC1_SPEC.

* gcc.dg/enum2.c: New test.
* gcc.dg/symbian3.c: Likewise.
* gcc.dg/symbian4.c: Likewise.
* gcc.dg/wchar_t-2.c: Likewise.

From-SVN: r85632

gcc/ChangeLog
gcc/config/arm/symbian.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/enum2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/symbian3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/symbian4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/wchar_t-2.c [new file with mode: 0644]

index b35bb6a8367a8c2de48b28b13ba85ac6d73c5f47..53bfd1f46e3304104474acdadf1a0f2508a167c0 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-06  Mark Mitchell  <mark@codesourcery.com>
+
+       * config/arm/symbian.h (CC1_SPEC): Add -fno-short-enums.
+       (CC1PLUS_SPEC): Define it to be the same as CC1_SPEC.
+
 2004-08-06  Roman Zippel  <zippel@linux-m68k.org>
  
         * config/m68k/m68k.c (post_inc_operand,pre_dec_operand): New.
index 2f8320de99e2d35bf8ed486882edcd3399459163..4ad4f46b74a47ee3debad66b0fbf31be3fe6fd71 100644 (file)
@@ -35,8 +35,8 @@
    Make all symbols hidden by default.  Symbian OS expects that all
    exported symbols will be explicitly marked with
    "__declspec(dllexport)".  */
-#define CC1_SPEC "-fno-builtin -fvisibility=hidden"
-#define CC1PLUS_SPEC "-fno-builtin -fvisibility=hidden"
+#define CC1_SPEC "-fno-builtin -fvisibility=hidden -fno-short-enums"
+#define CC1PLUS_SPEC CC1_SPEC
 
 /* Symbian OS does not use crt0.o, unlike the generic unknown-elf
    configuration.  */
index 02bff741a7309b71a87ecab9762538ae03ec2bf0..480bdcf24e1bf357dc0b7acdfa0750cac0bc99f9 100644 (file)
@@ -1,3 +1,10 @@
+2004-08-06  Mark Mitchell  <mark@codesourcery.com>
+
+       * gcc.dg/enum2.c: New test.
+       * gcc.dg/symbian3.c: Likewise.
+       * gcc.dg/symbian4.c: Likewise.
+       * gcc.dg/wchar_t-2.c: Likewise.
+
 2004-08-05  Mark Mitchell  <mark@codesourcery.com>
 
        * g++.dg/ext/visibility/visibility-8.C: Add constructor and
diff --git a/gcc/testsuite/gcc.dg/enum2.c b/gcc/testsuite/gcc.dg/enum2.c
new file mode 100644 (file)
index 0000000..575cc5c
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-options "-fshort-enums" } */
+/* Check that "-fshort-enums" packs enumeration tyes into a minimal
+   number of bytes..  */
+
+enum e { e_1 };
+
+extern int i[sizeof (enum e)];
+int i[1];
diff --git a/gcc/testsuite/gcc.dg/symbian3.c b/gcc/testsuite/gcc.dg/symbian3.c
new file mode 100644 (file)
index 0000000..2f11d35
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile { target arm*-*-symbianelf* } } */
+/* Check that enumeration types are 4-byte types.  */
+
+enum e { e_1 };
+
+extern int i[sizeof (enum e)];
+int i[4];
diff --git a/gcc/testsuite/gcc.dg/symbian4.c b/gcc/testsuite/gcc.dg/symbian4.c
new file mode 100644 (file)
index 0000000..20585a7
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do compile { target arm*-*-symbianelf* } } */
+/* Check that wchar_t is a 4-byte type.  */
+
+extern int i[sizeof (L'a')];
+int i[4];
diff --git a/gcc/testsuite/gcc.dg/wchar_t-2.c b/gcc/testsuite/gcc.dg/wchar_t-2.c
new file mode 100644 (file)
index 0000000..c51f252
--- /dev/null
@@ -0,0 +1,6 @@
+/* { dg-options "-fshort-wchar" } */
+/* Check that "-fshort-wchar" makes wchar_t the same size as "unsigned
+   short".  /
+
+extern int i[sizeof (L'a')];
+int i[sizeof (unsigned short)];