diff mbox

[testsuite] gcc.target/arm: skip 5 tests for flag conflicts

Message ID 505BD633.5090209@mentor.com
State New
Headers show

Commit Message

Janis Johnson Sept. 21, 2012, 2:51 a.m. UTC
This patch adds test directives to skip 5 tests in gcc.target/arm if the
flags specified for the test would be overridden by or conflict with
flags used for all tests, such as multilib flags.

Tested on arm-none-eabi with a variety of test flags.  I'll wait a day
or two before checking it in to give ARM experts a chance to comment.
I plan to backport to the 4.7 branch soon after it's in trunk.

Janis
2012-09-20  Janis Johnson  <janisjo@codesourcery.com>

	* gcc.target/arm/pr40887.c: Avoid conflicting flags.
	* gcc.target/arm/pr51835.c: Likewise.
	* gcc.target/arm/pr51915.c: Likewise.
	* gcc.target/arm/pr52006.c: Likewise.
	* gcc.target/arm/pr53187.c: Likewise.

Comments

Richard Earnshaw Oct. 10, 2012, 10:43 a.m. UTC | #1
On 21/09/12 03:51, Janis Johnson wrote:
> This patch adds test directives to skip 5 tests in gcc.target/arm if the
> flags specified for the test would be overridden by or conflict with
> flags used for all tests, such as multilib flags.
>
> Tested on arm-none-eabi with a variety of test flags.  I'll wait a day
> or two before checking it in to give ARM experts a chance to comment.
> I plan to backport to the 4.7 branch soon after it's in trunk.
>
> Janis
>
>
> gcc-20120920-1
>
>
> 2012-09-20  Janis Johnson  <janisjo@codesourcery.com>
>
> 	* gcc.target/arm/pr40887.c: Avoid conflicting flags.
> 	* gcc.target/arm/pr51835.c: Likewise.
> 	* gcc.target/arm/pr51915.c: Likewise.
> 	* gcc.target/arm/pr52006.c: Likewise.
> 	* gcc.target/arm/pr53187.c: Likewise.
>
> Index: gcc.target/arm/pr40887.c
> ===================================================================
> --- gcc.target/arm/pr40887.c	(revision 191502)
> +++ gcc.target/arm/pr40887.c	(working copy)
> @@ -1,3 +1,4 @@
> +/* { dg-skip-if " do not override -march" { *-*-* } { "-march=*" } { "-march=armv5te" } } */
>   /* { dg-options "-O2 -march=armv5te" }  */
>   /* { dg-final { scan-assembler "blx" } } */
>

It looks like this test should be run on ARMv5TE or later, so doesn't 
skipping this is weakening our testing?

As a secondary issue, -mcpu will override the -march setting quietly so 
we could end up with testsuite failures if the compiler was being tested 
with a -mcpu= flag.


> Index: gcc.target/arm/pr51835.c
> ===================================================================
> --- gcc.target/arm/pr51835.c	(revision 191502)
> +++ gcc.target/arm/pr51835.c	(working copy)
> @@ -1,6 +1,8 @@
>   /* { dg-do compile } */
> +/* { dg-require-effective-target arm_thumb2_ok } */
> +/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
> +/* { dg-skip-if "do not override -mfpu" { *-*-* } { "-mfpu=*" } { "-mfpu=fpv4-sp-d16" } } */
>   /* { dg-options "-O2 -mfloat-abi=hard -mfpu=fpv4-sp-d16" }  */
> -/* { dg-require-effective-target arm_thumb2_ok } */
>

Similarly, doesn't this weaken our test coverage?


>   int func1 (double d)
>   {
> Index: gcc.target/arm/pr51915.c
> ===================================================================
> --- gcc.target/arm/pr51915.c	(revision 191502)
> +++ gcc.target/arm/pr51915.c	(working copy)
> @@ -1,5 +1,7 @@
>   /* PR target/51915 */
>   /* { dg-do compile } */
> +/* { dg-skip-if "do not override -march" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
> +/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
>   /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
>
>   struct S { int s1; void *s2; };
> Index: gcc.target/arm/pr52006.c
> ===================================================================
> --- gcc.target/arm/pr52006.c	(revision 191502)
> +++ gcc.target/arm/pr52006.c	(working copy)
> @@ -1,5 +1,7 @@
>   /* PR target/52006 */
>   /* { dg-do compile } */
> +/* { dg-skip-if "do not override -march=" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
> +/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
>   /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2 -fPIC" } */
>
>   unsigned long a;
> Index: gcc.target/arm/pr53187.c
> ===================================================================
> --- gcc.target/arm/pr53187.c	(revision 191502)
> +++ gcc.target/arm/pr53187.c	(working copy)
> @@ -1,5 +1,6 @@
>   /* PR target/53187 */
>   /* { dg-do compile } */
> +/* { dg-skip-if "do not override -march" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
>   /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
>
>   void bar (int);
>

And the same for the rest.

Remind me again, why dg-options are on the command line before the 
multilib options.

R.
Janis Johnson Oct. 12, 2012, 8:04 p.m. UTC | #2
On 10/10/2012 03:43 AM, Richard Earnshaw wrote:
> On 21/09/12 03:51, Janis Johnson wrote:
>> This patch adds test directives to skip 5 tests in gcc.target/arm if the
>> flags specified for the test would be overridden by or conflict with
>> flags used for all tests, such as multilib flags.
>>
>> Tested on arm-none-eabi with a variety of test flags.  I'll wait a day
>> or two before checking it in to give ARM experts a chance to comment.
>> I plan to backport to the 4.7 branch soon after it's in trunk.
>>
>> Janis
>>
>>
>> gcc-20120920-1
>>
>>
>> 2012-09-20  Janis Johnson  <janisjo@codesourcery.com>
>>
>> 	* gcc.target/arm/pr40887.c: Avoid conflicting flags.
>> 	* gcc.target/arm/pr51835.c: Likewise.
>> 	* gcc.target/arm/pr51915.c: Likewise.
>> 	* gcc.target/arm/pr52006.c: Likewise.
>> 	* gcc.target/arm/pr53187.c: Likewise.
>>
>> Index: gcc.target/arm/pr40887.c
>> ===================================================================
>> --- gcc.target/arm/pr40887.c	(revision 191502)
>> +++ gcc.target/arm/pr40887.c	(working copy)
>> @@ -1,3 +1,4 @@
>> +/* { dg-skip-if " do not override -march" { *-*-* } { "-march=*" } { "-march=armv5te" } } */
>>   /* { dg-options "-O2 -march=armv5te" }  */
>>   /* { dg-final { scan-assembler "blx" } } */
>>
> 
> It looks like this test should be run on ARMv5TE or later, so doesn't 
> skipping this is weakening our testing?
> 
> As a secondary issue, -mcpu will override the -march setting quietly so 
> we could end up with testsuite failures if the compiler was being tested 
> with a -mcpu= flag.
> 
> 
>> Index: gcc.target/arm/pr51835.c
>> ===================================================================
>> --- gcc.target/arm/pr51835.c	(revision 191502)
>> +++ gcc.target/arm/pr51835.c	(working copy)
>> @@ -1,6 +1,8 @@
>>   /* { dg-do compile } */
>> +/* { dg-require-effective-target arm_thumb2_ok } */
>> +/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
>> +/* { dg-skip-if "do not override -mfpu" { *-*-* } { "-mfpu=*" } { "-mfpu=fpv4-sp-d16" } } */
>>   /* { dg-options "-O2 -mfloat-abi=hard -mfpu=fpv4-sp-d16" }  */
>> -/* { dg-require-effective-target arm_thumb2_ok } */
>>
> 
> Similarly, doesn't this weaken our test coverage?
> 
> 
>>   int func1 (double d)
>>   {
>> Index: gcc.target/arm/pr51915.c
>> ===================================================================
>> --- gcc.target/arm/pr51915.c	(revision 191502)
>> +++ gcc.target/arm/pr51915.c	(working copy)
>> @@ -1,5 +1,7 @@
>>   /* PR target/51915 */
>>   /* { dg-do compile } */
>> +/* { dg-skip-if "do not override -march" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
>> +/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
>>   /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
>>
>>   struct S { int s1; void *s2; };
>> Index: gcc.target/arm/pr52006.c
>> ===================================================================
>> --- gcc.target/arm/pr52006.c	(revision 191502)
>> +++ gcc.target/arm/pr52006.c	(working copy)
>> @@ -1,5 +1,7 @@
>>   /* PR target/52006 */
>>   /* { dg-do compile } */
>> +/* { dg-skip-if "do not override -march=" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
>> +/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
>>   /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2 -fPIC" } */
>>
>>   unsigned long a;
>> Index: gcc.target/arm/pr53187.c
>> ===================================================================
>> --- gcc.target/arm/pr53187.c	(revision 191502)
>> +++ gcc.target/arm/pr53187.c	(working copy)
>> @@ -1,5 +1,6 @@
>>   /* PR target/53187 */
>>   /* { dg-do compile } */
>> +/* { dg-skip-if "do not override -march" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
>>   /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
>>
>>   void bar (int);
>>
> 
> And the same for the rest.
> 
> Remind me again, why dg-options are on the command line before the 
> multilib options.
> 
> R.

Richard,

I'll answer your last question and then we can figure out what to do
about my proposed changes to limit multilibs with which specific tests
are run.

Flags from dg-options are on the command line before multilib options
because that's how it's always been handled in DejaGnu, specifically in
default_target_compile in DejaGnu's lib/target.exp, which puts multilib
flags at the end of the long list of options it passes to the compiler.
The GCC testsuite could override that proc but it would be messy and
would probably break lots of tests that expect multilib options to
override everything else.

The purpose of multilib options is to run every single test for that
multilib and provide as much coverage as possible for the multilib.
Tests for specific -march/-mcpu/whatever options need to be skipped for
multilibs that conflict with those options.  Similarly, a test for
specific functionality that doesn't use dg-options can be skipped for
all multilibs that don't support that functionality.

If each multilib specifies -march/-mcpu/whatever then tests that specify
conflicting options will never be run.  If there's a multilib that uses
defaults then it can run the tests with specific options, and there's no
need to try to run those tests for other multilibs as well.

I've sometimes thought that gcc.target/arm should have a child directory
that's only run for multilibs that don't use -march/-mcpu/etc, to avoid
cluttering up individual tests with skips for conflicting options.

Janis
diff mbox

Patch

Index: gcc.target/arm/pr40887.c
===================================================================
--- gcc.target/arm/pr40887.c	(revision 191502)
+++ gcc.target/arm/pr40887.c	(working copy)
@@ -1,3 +1,4 @@ 
+/* { dg-skip-if " do not override -march" { *-*-* } { "-march=*" } { "-march=armv5te" } } */
 /* { dg-options "-O2 -march=armv5te" }  */
 /* { dg-final { scan-assembler "blx" } } */

Index: gcc.target/arm/pr51835.c
===================================================================
--- gcc.target/arm/pr51835.c	(revision 191502)
+++ gcc.target/arm/pr51835.c	(working copy)
@@ -1,6 +1,8 @@ 
 /* { dg-do compile } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
+/* { dg-skip-if "do not override -mfpu" { *-*-* } { "-mfpu=*" } { "-mfpu=fpv4-sp-d16" } } */
 /* { dg-options "-O2 -mfloat-abi=hard -mfpu=fpv4-sp-d16" }  */
-/* { dg-require-effective-target arm_thumb2_ok } */
 
 int func1 (double d)
 {
Index: gcc.target/arm/pr51915.c
===================================================================
--- gcc.target/arm/pr51915.c	(revision 191502)
+++ gcc.target/arm/pr51915.c	(working copy)
@@ -1,5 +1,7 @@ 
 /* PR target/51915 */
 /* { dg-do compile } */
+/* { dg-skip-if "do not override -march" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
 /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
 
 struct S { int s1; void *s2; };
Index: gcc.target/arm/pr52006.c
===================================================================
--- gcc.target/arm/pr52006.c	(revision 191502)
+++ gcc.target/arm/pr52006.c	(working copy)
@@ -1,5 +1,7 @@ 
 /* PR target/52006 */
 /* { dg-do compile } */
+/* { dg-skip-if "do not override -march=" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
+/* { dg-skip-if "do not override -mfloat-abi" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" } } */
 /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2 -fPIC" } */
 
 unsigned long a;
Index: gcc.target/arm/pr53187.c
===================================================================
--- gcc.target/arm/pr53187.c	(revision 191502)
+++ gcc.target/arm/pr53187.c	(working copy)
@@ -1,5 +1,6 @@ 
 /* PR target/53187 */
 /* { dg-do compile } */
+/* { dg-skip-if "do not override -march" { *-*-* } { "-march=*" } { "-march=armv7-a" } } */
 /* { dg-options "-march=armv7-a -mfloat-abi=hard -O2" } */
 
 void bar (int);