symbian.h (CC1_SPEC): Avoid passing duplicate options to the compiler.
authorMark Mitchell <mark@codesourcery.com>
Fri, 6 Aug 2004 17:51:45 +0000 (17:51 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 6 Aug 2004 17:51:45 +0000 (17:51 +0000)
* config/arm/symbian.h (CC1_SPEC): Avoid passing duplicate options
to the compiler.  Use -fshort-wchar by default.

* gcc.dg/symbian4.c: Expect a 2-byte wchar_t, not a 4-byte
wchar_t.
* gcc.dg/symbian5.c: Test -fno-short-wchar.

From-SVN: r85648

gcc/ChangeLog
gcc/config/arm/symbian.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/symbian4.c
gcc/testsuite/gcc.dg/symbian5.c [new file with mode: 0644]

index 1318c7cd2c228bdbdcb09cf34ec516f255b787e7..a55a3d92921322ed9b91fe956a866ee3d5eb9774 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-06  Mark Mitchell  <mark@codesourcery.com>
+
+       * config/arm/symbian.h (CC1_SPEC): Avoid passing duplicate options
+       to the compiler.  Use -fshort-wchar by default.
+
 2004-08-06  Pat Haugen  <pthaugen@us.ibm.com>
 
        * params.def (PARAM_MIN_CROSSJUMP_INSNS): New.
index 4ad4f46b74a47ee3debad66b0fbf31be3fe6fd71..c03b428e692a612aefc130b7110f65bcaf818415 100644 (file)
 
    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 -fno-short-enums"
+   "__declspec(dllexport)".  
+
+   Enumeration types use 4 bytes, even if the enumerals are small,
+   unless explicitly overridden.
+
+   The wchar_t type is a 2-byte type, unless explicitly
+   overridden.  */
+#define CC1_SPEC                                               \
+  "%{!fbuiltin:%{!fno-builtin:-fno-builtin}} "                 \
+  "%{!fvisibility=*:-fvisibility=hidden} "                     \
+  "%{!fshort-enums:%{!fno-short-enums:-fno-short-enums}} "     \
+  "%{!fshort-wchar:%{!fno-short-wchar:-fshort-wchar}} "
 #define CC1PLUS_SPEC CC1_SPEC
 
 /* Symbian OS does not use crt0.o, unlike the generic unknown-elf
index f2d9a977be5d3778b94f2c0c6f992107f4ef4856..63ca7a78c50c575ef716240b3c622b90892bc694 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-06  Mark Mitchell  <mark@codesourcery.com>
+
+       * gcc.dg/symbian4.c: Expect a 2-byte wchar_t, not a 4-byte
+       wchar_t.
+       * gcc.dg/symbian5.c: Test -fno-short-wchar.
+
 2004-08-06  Paul Brook  <paul@codesourcery.com>
 
        * gfortran.dg/ret_array_1.f90: New test.
index 20585a713208c42afc5d6b142bb7860f2adf655a..aede7f5c66c6014693aa6665ce1d0cca5e3bba47 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile { target arm*-*-symbianelf* } } */
-/* Check that wchar_t is a 4-byte type.  */
+/* Check that wchar_t is a 2-byte type.  */
 
 extern int i[sizeof (L'a')];
-int i[4];
+int i[2];
diff --git a/gcc/testsuite/gcc.dg/symbian5.c b/gcc/testsuite/gcc.dg/symbian5.c
new file mode 100644 (file)
index 0000000..0bde6b0
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do compile { target arm*-*-symbianelf* } } */
+/* { dg-options "-fno-short-wchar" } */
+/* Check that wchar_t is a 4-byte type when -fno-short-wchar is
+   used.  */
+
+extern int i[sizeof (L'a')];
+int i[4];
+