From: Mark Mitchell Date: Fri, 6 Aug 2004 07:54:19 +0000 (+0000) Subject: symbian.h (CC1_SPEC): Add -fno-short-enums. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=866cf0373156f1a614d620522caef62a36b2b5e4;p=gcc.git symbian.h (CC1_SPEC): Add -fno-short-enums. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b35bb6a8367..53bfd1f46e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-06 Mark Mitchell + + * 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 * config/m68k/m68k.c (post_inc_operand,pre_dec_operand): New. diff --git a/gcc/config/arm/symbian.h b/gcc/config/arm/symbian.h index 2f8320de99e..4ad4f46b74a 100644 --- a/gcc/config/arm/symbian.h +++ b/gcc/config/arm/symbian.h @@ -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. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 02bff741a73..480bdcf24e1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2004-08-06 Mark Mitchell + + * 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 * 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 index 00000000000..575cc5ce086 --- /dev/null +++ b/gcc/testsuite/gcc.dg/enum2.c @@ -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 index 00000000000..2f11d355b4d --- /dev/null +++ b/gcc/testsuite/gcc.dg/symbian3.c @@ -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 index 00000000000..20585a71320 --- /dev/null +++ b/gcc/testsuite/gcc.dg/symbian4.c @@ -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 index 00000000000..c51f252a38c --- /dev/null +++ b/gcc/testsuite/gcc.dg/wchar_t-2.c @@ -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)];