This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix some tests that require no-short-enums
- From: "Ian Bolton" <ian dot bolton at arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 15 Nov 2010 12:42:27 -0000
- Subject: [PATCH] Fix some tests that require no-short-enums
The following two test cases were failing bare-metal on ARM, but
working on Linux:
gcc.c-torture/compile/pr39845.c
c-c++-common/pr44832.c
Both failed to compile: "error: width of 'code' exceeds its type".
The fix was to make them compile with -fno-short-enums, as the
tests implicitly require this (it's the default on Linux), but it
needs to be explicitly requested on "short_enums" targets.
The fixed tests now pass bare-metal (and Linux).
OK for trunk?
Cheers,
Ian
2010-11-15 Ian Bolton <ian.bolton@arm.com>
* testsuite/c-c++-common/pr44832.c: Use -fno-short-enums
option for "target short_enums".
* testsuite/gcc.c-torture/compile/pr39845.c: Likewise.
Index: gcc/testsuite/gcc.c-torture/compile/pr39845.c
===================================================================
--- gcc/testsuite/gcc.c-torture/compile/pr39845.c (revision 166433)
+++ gcc/testsuite/gcc.c-torture/compile/pr39845.c (working copy)
@@ -1,3 +1,5 @@
+
+/* { dg-options "-fno-short-enums" {target short_enums} } */
typedef union tree_node *tree;
enum tree_code { EXCESS_PRECISION_EXPR };
enum built_in_function { BUILT_IN_ACOS, BUILT_IN_FPCLASSIFY,
BUILT_IN_ISFINITE };
Index: gcc/testsuite/c-c++-common/pr44832.c
===================================================================
--- gcc/testsuite/c-c++-common/pr44832.c (revision 166433)
+++ gcc/testsuite/c-c++-common/pr44832.c (working copy)
@@ -1,6 +1,7 @@
/* PR debug/44832 */
/* { dg-do compile } */
/* { dg-options "-O2 -fcompare-debug" } */
+/* { dg-options "-O2 -fcompare-debug -fno-short-enums" {target short_enums}
} */
struct rtx_def;
typedef struct rtx_def *rtx;