Patchwork [testsuite] Use long enums for case foldconst-3.c for target ARM EABI.

login
register
mail settings
Submitter Terry Guo
Date Sept. 11, 2011, 1:39 a.m.
Message ID <003301cc7023$9e203960$da60ac20$@guo@arm.com>
Download mbox | patch
Permalink /patch/114204/
State New
Headers show

Comments

Terry Guo - Sept. 11, 2011, 1:39 a.m.
Hello,

This patch aims to disable short enums for arm eabi otherwise the case will
fail to be compiled due to "width of 'code' exceeds its type". Is it OK to
trunk?

BR,
Terry

2011-09-09  Terry Guo  <terry.guo@arm.com>

	  * gcc.dg/tree-ssa/foldconst-3.c: Use -fno-short-enums 
        for ARM EABI target.

 {
Richard Earnshaw - Sept. 16, 2011, 8:15 a.m.
On 11/09/11 02:39, Terry Guo wrote:
> Hello,
> 
> This patch aims to disable short enums for arm eabi otherwise the case will
> fail to be compiled due to "width of 'code' exceeds its type". Is it OK to
> trunk?
> 
> BR,
> Terry
> 
> 2011-09-09  Terry Guo  <terry.guo@arm.com>
> 
> 	  * gcc.dg/tree-ssa/foldconst-3.c: Use -fno-short-enums 
>         for ARM EABI target.
> 
> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
> b/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
> index 6132362..e030f53 100644
> --- a/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
> @@ -1,5 +1,6 @@
>  /* { dg-do compile } */
>  /* { dg-options "-O2 -fdump-tree-optimized" } */
> +/* { dg-options "-O2 -fdump-tree-optimized -fno-short-enums" { target
> arm_eabi } } */
>  typedef const union tree_node *const_tree;
>  typedef struct
>  {
> 
>

This is a compile-only test, and -fno-short-enums is a global option
that all targets support, so I'd suggest just adding -fno-short-enums to
the standard list of options.  It won't hurt those platforms where that
is already the default and it will fix the testcase problem for all
those platforms where it isn't.

R.

Patch

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
b/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
index 6132362..e030f53 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/foldconst-3.c
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fno-short-enums" { target
arm_eabi } } */
 typedef const union tree_node *const_tree;
 typedef struct