diff mbox

Fix some tests that require no-short-enums

Message ID 000001cb84c2$8fcb7a70$af626f50$@bolton@arm.com
State New
Headers show

Commit Message

Ian Bolton Nov. 15, 2010, 12:42 p.m. UTC
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.


 typedef struct rtx_def *rtx;

Comments

Richard Earnshaw Nov. 17, 2010, 5:43 p.m. UTC | #1
On Mon, 2010-11-15 at 12:42 +0000, Ian Bolton wrote:
> 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?
> 

Looks sensible to me.

OK to commit this if no testsuite maintainer objects within 24 hours.

R.

> 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;
> 
>
Ian Bolton Nov. 22, 2010, 3:55 p.m. UTC | #2
> > 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?
> >
> 
> Looks sensible to me.
> 
> OK to commit this if no testsuite maintainer objects within 24 hours.

I have now committed this to trunk.

Cheers,
Ian
diff mbox

Patch

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;