diff mbox

[testsuite] skip ARM tests with conflicting options

Message ID 4DEE8FE7.50001@codesourcery.com
State New
Headers show

Commit Message

Janis Johnson June 7, 2011, 8:53 p.m. UTC
Several tests in gcc.target/arm use dg-options with -mcpu=xxxx, which
causes compiler warnings or errors when the multilib flags include
-march=yyyy.  This patch causes those tests to be skipped.  It also
prevents gcc.target/arm/20090811-1.c from running with multilibs that
would override -mcpu or -mfloat-abi options specified for the test.

Tested on arm-none-linux-gnueabi for several multilibs; these tests
are compile-only so it didn't matter that I didn't have runtime
support for them.

OK for trunk and 4.6 branch?  (This is just the tip of the iceberg.)
2011-06-07  Janis Johnson  <janisjo@codesourcery.com>

	* gcc.target/arm/20090811-1.c: Skip for incompatible options, do not
	override other options.
	* gcc.target/arm/combine-cmp-shift.c: Skip for incompatible options.
	* gcc.target/arm/pr45094.c: Likewise.
	* gcc.target/arm/scd42-1.c: Likewise.
	* gcc.target/arm/scd42-3.c: Likewise.
	* gcc.target/arm/thumb-ltu.c: Likewise.

Comments

Joseph Myers June 7, 2011, 9:07 p.m. UTC | #1
On Tue, 7 Jun 2011, Janis Johnson wrote:

> Several tests in gcc.target/arm use dg-options with -mcpu=xxxx, which
> causes compiler warnings or errors when the multilib flags include
> -march=yyyy.  This patch causes those tests to be skipped.  It also
> prevents gcc.target/arm/20090811-1.c from running with multilibs that
> would override -mcpu or -mfloat-abi options specified for the test.

I think you should allow compatible -march options - for example, if 
dg-options has -mcpu=cortex-a8, allow -march=armv7-a but disallow all 
other -march options.
Janis Johnson June 7, 2011, 10:02 p.m. UTC | #2
On 06/07/2011 02:07 PM, Joseph S. Myers wrote:
> On Tue, 7 Jun 2011, Janis Johnson wrote:
> 
>> Several tests in gcc.target/arm use dg-options with -mcpu=xxxx, which
>> causes compiler warnings or errors when the multilib flags include
>> -march=yyyy.  This patch causes those tests to be skipped.  It also
>> prevents gcc.target/arm/20090811-1.c from running with multilibs that
>> would override -mcpu or -mfloat-abi options specified for the test.
> 
> I think you should allow compatible -march options - for example, if 
> dg-options has -mcpu=cortex-a8, allow -march=armv7-a but disallow all 
> other -march options.
> 

OK, I'll try again with that change, thanks.

Janis
diff mbox

Patch

Index: gcc/testsuite/gcc.target/arm/20090811-1.c
===================================================================
--- gcc/testsuite/gcc.target/arm/20090811-1.c	(revision 174706)
+++ gcc/testsuite/gcc.target/arm/20090811-1.c	(working copy)
@@ -1,4 +1,7 @@ 
 /* { dg-do compile } */
+/* { dg-skip-if "incompatible options" { arm*-*-* } { "-march=*" } { "" } } */
+/* { dg-skip-if "do not override -mcpu" { *-*-* } { "-mcpu=*" } { "-mcpu=cortex-a8" } } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=softfp" } } */
 /* { dg-options "-O3 -mcpu=cortex-a8 -mfpu=vfp3 -mfloat-abi=softfp" } */
 
 typedef struct cb
Index: gcc/testsuite/gcc.target/arm/combine-cmp-shift.c
===================================================================
--- gcc/testsuite/gcc.target/arm/combine-cmp-shift.c	(revision 174706)
+++ gcc/testsuite/gcc.target/arm/combine-cmp-shift.c	(working copy)
@@ -1,3 +1,4 @@ 
+/* { dg-skip-if "incompatible options" { arm*-*-* } { "-march=*" } { "" } } */
 /* { dg-options "-O2 -mcpu=cortex-a8" }  */
 /* { dg-final { scan-assembler "cmp\tr\[0-9\]*, r\[0-9\]*, asr #31" } } */
 
Index: gcc/testsuite/gcc.target/arm/pr45094.c
===================================================================
--- gcc/testsuite/gcc.target/arm/pr45094.c	(revision 174706)
+++ gcc/testsuite/gcc.target/arm/pr45094.c	(working copy)
@@ -1,4 +1,5 @@ 
 /* { dg-do run } */
+/* { dg-skip-if "incompatible options" { arm*-*-* } { "-march=*" } { "" } } */
 /* { dg-require-effective-target arm_neon_hw } */
 /* { dg-options "-O2 -mcpu=cortex-a8" } */
 /* { dg-add-options arm_neon } */
Index: gcc/testsuite/gcc.target/arm/scd42-1.c
===================================================================
--- gcc/testsuite/gcc.target/arm/scd42-1.c	(revision 174706)
+++ gcc/testsuite/gcc.target/arm/scd42-1.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* Verify that mov is preferred on XScale for loading a 1 byte constant. */
 /* { dg-do compile } */
+/* { dg-skip-if "incompatible options" { arm*-*-* } { "-march=*" } { "" } } */
 /* { dg-options "-mcpu=xscale -O" } */
 
 unsigned load1(void) __attribute__ ((naked));
Index: gcc/testsuite/gcc.target/arm/scd42-3.c
===================================================================
--- gcc/testsuite/gcc.target/arm/scd42-3.c	(revision 174706)
+++ gcc/testsuite/gcc.target/arm/scd42-3.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* Verify that ldr is preferred on XScale for loading a 3 or 4 byte constant. */
 /* { dg-do compile } */
+/* { dg-skip-if "incompatible options" { arm*-*-* } { "-march=*" } { "" } } */
 /* { dg-options "-mcpu=xscale -O" } */
 
 unsigned load4(void) __attribute__ ((naked));
Index: gcc/testsuite/gcc.target/arm/thumb-ltu.c
===================================================================
--- gcc/testsuite/gcc.target/arm/thumb-ltu.c	(revision 174706)
+++ gcc/testsuite/gcc.target/arm/thumb-ltu.c	(working copy)
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-skip-if "incompatible options" { arm*-*-* } { "-march=*" } { "" } } */
 /* { dg-options "-mcpu=arm1136jf-s -mthumb -O2" } */
 
 void f(unsigned a, unsigned b, unsigned c, unsigned d)