[testsuite] Fix powerpc-specific portions of PR85326

Message ID 8fca872e-a0f5-d70e-42b8-8eb1d30c672c@linux.ibm.com
State New
Headers show
Series
  • [testsuite] Fix powerpc-specific portions of PR85326
Related show

Commit Message

Bill Schmidt April 15, 2018, 9:53 p.m.
Hi,

This test fixes the part of PR85326 that involves powerpc test cases.
It removes support for .C tests in gcc.target/powerpc and moves the
one .C test from that directory to g++.dg with target constraints.
Tested on powerpc64le-linux-gnu.  Okay for trunk?

Thanks,
Bill


[gcc/testsuite]

2018-04-15  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR testsuite/85326
	* g++.dg/undef-bool-1.C:  New file.
	* gcc.target/powerpc/powerpc.exp:  Remove .C support.
	* gcc.target/powerpc/undef-bool-1.C:  Remove file.

Comments

Jakub Jelinek April 15, 2018, 10:50 p.m. | #1
On Sun, Apr 15, 2018 at 04:53:27PM -0500, Bill Schmidt wrote:
> 2018-04-15  Bill Schmidt  <wschmidt@linux.ibm.com>
> 
> 	PR testsuite/85326
> 	* g++.dg/undef-bool-1.C:  New file.

Tests really shouldn't be added to g++.dg/ directly, but to subdirectories
thereof.
In this case, I think g++.dg/ext/undef-bool-1.C is the right location.
And see below.

Also, just a single space in between : and description in the ChangeLog
file.  Otherwise LGTM, but please wait for PowerPC maintainer ack.

> 	* gcc.target/powerpc/powerpc.exp:  Remove .C support.
> 	* gcc.target/powerpc/undef-bool-1.C:  Remove file.
> 
> 
> Index: gcc/testsuite/g++.dg/undef-bool-1.C
> ===================================================================
> --- gcc/testsuite/g++.dg/undef-bool-1.C	(nonexistent)
> +++ gcc/testsuite/g++.dg/undef-bool-1.C	(working copy)
> @@ -0,0 +1,13 @@
> +/* { dg-do compile { target { powerpc*-*-* } } } */
> +/* { dg-options "-O2 -std=c++11 -DNO_WARN_X86_INTRINSICS" } */

g++.dg/ tests are cycled through some or all -std= options, so
rather than -std=c++11 you should require effective target c++11,
or if you want to run it for -std=c++11 only and not others, c++11only.
Though in this testcase I don't see a reason why it wouldn't work even with
c++14, c++17 or c++2a.

	Jakub
Bill Schmidt April 15, 2018, 11:08 p.m. | #2
On Apr 15, 2018, at 5:50 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> 
> On Sun, Apr 15, 2018 at 04:53:27PM -0500, Bill Schmidt wrote:
>> 2018-04-15  Bill Schmidt  <wschmidt@linux.ibm.com>
>> 
>> 	PR testsuite/85326
>> 	* g++.dg/undef-bool-1.C:  New file.
> 
> Tests really shouldn't be added to g++.dg/ directly, but to subdirectories
> thereof.
> In this case, I think g++.dg/ext/undef-bool-1.C is the right location.
> And see below.
> 
> Also, just a single space in between : and description in the ChangeLog
> file.  Otherwise LGTM, but please wait for PowerPC maintainer ack.
> 
>> 	* gcc.target/powerpc/powerpc.exp:  Remove .C support.
>> 	* gcc.target/powerpc/undef-bool-1.C:  Remove file.
>> 
>> 
>> Index: gcc/testsuite/g++.dg/undef-bool-1.C
>> ===================================================================
>> --- gcc/testsuite/g++.dg/undef-bool-1.C	(nonexistent)
>> +++ gcc/testsuite/g++.dg/undef-bool-1.C	(working copy)
>> @@ -0,0 +1,13 @@
>> +/* { dg-do compile { target { powerpc*-*-* } } } */
>> +/* { dg-options "-O2 -std=c++11 -DNO_WARN_X86_INTRINSICS" } */
> 
> g++.dg/ tests are cycled through some or all -std= options, so
> rather than -std=c++11 you should require effective target c++11,
> or if you want to run it for -std=c++11 only and not others, c++11only.
> Though in this testcase I don't see a reason why it wouldn't work even with
> c++14, c++17 or c++2a.

OK, agreed on all fronts.  Segher, okay with these changes?

Thanks,
Bill

> 
> 	Jakub
>
Segher Boessenkool April 15, 2018, 11:29 p.m. | #3
On Sun, Apr 15, 2018 at 06:08:44PM -0500, Bill Schmidt wrote:
> On Apr 15, 2018, at 5:50 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> > 
> > On Sun, Apr 15, 2018 at 04:53:27PM -0500, Bill Schmidt wrote:
> >> 2018-04-15  Bill Schmidt  <wschmidt@linux.ibm.com>
> >> 
> >> 	PR testsuite/85326
> >> 	* g++.dg/undef-bool-1.C:  New file.
> > 
> > Tests really shouldn't be added to g++.dg/ directly, but to subdirectories
> > thereof.
> > In this case, I think g++.dg/ext/undef-bool-1.C is the right location.
> > And see below.
> > 
> > Also, just a single space in between : and description in the ChangeLog
> > file.  Otherwise LGTM, but please wait for PowerPC maintainer ack.
> > 
> >> 	* gcc.target/powerpc/powerpc.exp:  Remove .C support.
> >> 	* gcc.target/powerpc/undef-bool-1.C:  Remove file.
> >> 
> >> 
> >> Index: gcc/testsuite/g++.dg/undef-bool-1.C
> >> ===================================================================
> >> --- gcc/testsuite/g++.dg/undef-bool-1.C	(nonexistent)
> >> +++ gcc/testsuite/g++.dg/undef-bool-1.C	(working copy)
> >> @@ -0,0 +1,13 @@
> >> +/* { dg-do compile { target { powerpc*-*-* } } } */
> >> +/* { dg-options "-O2 -std=c++11 -DNO_WARN_X86_INTRINSICS" } */
> > 
> > g++.dg/ tests are cycled through some or all -std= options, so
> > rather than -std=c++11 you should require effective target c++11,
> > or if you want to run it for -std=c++11 only and not others, c++11only.
> > Though in this testcase I don't see a reason why it wouldn't work even with
> > c++14, c++17 or c++2a.
> 
> OK, agreed on all fronts.  Segher, okay with these changes?

Sure!  But does it even need c++11?  Maybe something in the headers does?
(/me tries...  Seems to work fine with -std=c++98, too?)

Thanks for the patch,


Segher
Bill Schmidt April 16, 2018, 12:32 a.m. | #4
On Apr 15, 2018, at 6:29 PM, Segher Boessenkool <segher@kernel.crashing.org> wrote:
> 
> On Sun, Apr 15, 2018 at 06:08:44PM -0500, Bill Schmidt wrote:
>> On Apr 15, 2018, at 5:50 PM, Jakub Jelinek <jakub@redhat.com> wrote:
>>> 
>>> On Sun, Apr 15, 2018 at 04:53:27PM -0500, Bill Schmidt wrote:
>>>> 2018-04-15  Bill Schmidt  <wschmidt@linux.ibm.com>
>>>> 
>>>> 	PR testsuite/85326
>>>> 	* g++.dg/undef-bool-1.C:  New file.
>>> 
>>> Tests really shouldn't be added to g++.dg/ directly, but to subdirectories
>>> thereof.
>>> In this case, I think g++.dg/ext/undef-bool-1.C is the right location.
>>> And see below.
>>> 
>>> Also, just a single space in between : and description in the ChangeLog
>>> file.  Otherwise LGTM, but please wait for PowerPC maintainer ack.
>>> 
>>>> 	* gcc.target/powerpc/powerpc.exp:  Remove .C support.
>>>> 	* gcc.target/powerpc/undef-bool-1.C:  Remove file.
>>>> 
>>>> 
>>>> Index: gcc/testsuite/g++.dg/undef-bool-1.C
>>>> ===================================================================
>>>> --- gcc/testsuite/g++.dg/undef-bool-1.C	(nonexistent)
>>>> +++ gcc/testsuite/g++.dg/undef-bool-1.C	(working copy)
>>>> @@ -0,0 +1,13 @@
>>>> +/* { dg-do compile { target { powerpc*-*-* } } } */
>>>> +/* { dg-options "-O2 -std=c++11 -DNO_WARN_X86_INTRINSICS" } */
>>> 
>>> g++.dg/ tests are cycled through some or all -std= options, so
>>> rather than -std=c++11 you should require effective target c++11,
>>> or if you want to run it for -std=c++11 only and not others, c++11only.
>>> Though in this testcase I don't see a reason why it wouldn't work even with
>>> c++14, c++17 or c++2a.
>> 
>> OK, agreed on all fronts.  Segher, okay with these changes?
> 
> Sure!  But does it even need c++11?  Maybe something in the headers does?
> (/me tries...  Seems to work fine with -std=c++98, too?)

Agreed, there shouldn't be a need to check it so long as we're guaranteed
to have it tested for c++11.  I'll remove the option.

Thanks!

Bill
> 
> Thanks for the patch,
> 
> 
> Segher

Patch

Index: gcc/testsuite/g++.dg/undef-bool-1.C
===================================================================
--- gcc/testsuite/g++.dg/undef-bool-1.C	(nonexistent)
+++ gcc/testsuite/g++.dg/undef-bool-1.C	(working copy)
@@ -0,0 +1,13 @@ 
+/* { dg-do compile { target { powerpc*-*-* } } } */
+/* { dg-options "-O2 -std=c++11 -DNO_WARN_X86_INTRINSICS" } */
+
+/* Test to ensure that "bool" gets undef'd in xmmintrin.h when
+   we require strict ANSI.  */
+
+#include <xmmintrin.h>
+
+bool foo (int x)
+{
+  return x == 2;
+}
+
Index: gcc/testsuite/gcc.target/powerpc/powerpc.exp
===================================================================
--- gcc/testsuite/gcc.target/powerpc/powerpc.exp	(revision 259389)
+++ gcc/testsuite/gcc.target/powerpc/powerpc.exp	(working copy)
@@ -35,7 +35,7 @@  if ![info exists DEFAULT_CFLAGS] then {
 dg-init
 
 # Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cCS\]]] \
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
 	"" $DEFAULT_CFLAGS
 
 set SAVRES_TEST_OPTS [list -Os -O2 {-Os -mno-multiple} {-O2 -mno-multiple}]
Index: gcc/testsuite/gcc.target/powerpc/undef-bool-1.C
===================================================================
--- gcc/testsuite/gcc.target/powerpc/undef-bool-1.C	(revision 259389)
+++ gcc/testsuite/gcc.target/powerpc/undef-bool-1.C	(nonexistent)
@@ -1,13 +0,0 @@ 
-/* { dg-do compile } */
-/* { dg-options "-O2 -std=c++11 -DNO_WARN_X86_INTRINSICS" } */
-
-/* Test to ensure that "bool" gets undef'd in xmmintrin.h when
-   we require strict ANSI.  */
-
-#include <xmmintrin.h>
-
-bool foo (int x)
-{
-  return x == 2;
-}
-