diff mbox

Fix new split-1.c testcase

Message ID 5fcdb23b55b49dffea1b6c1f1992e7527dfd5183.1497180698.git.segher@kernel.crashing.org
State New
Headers show

Commit Message

Segher Boessenkool June 11, 2017, 11:40 a.m. UTC
The new split-1.c testcase fails on targets that do not support split
stack (like 32-bit PowerPC Linux).  This patch fixes it by only running
the testcase if split stack is supported.  It also adds the reorder
flag to the options, so that the test actually tests what it says it
tests.

Is this okay for trunk?


Segher


2017-06-11  Segher Boessenkool  <segher@kernel.crashing.org>

gcc/testsuite/
	* gcc.dg/tree-prof/split-1.c: Require effective target split_stack.
	Add -freorder-blocks-and-partition to options.

---
 gcc/testsuite/gcc.dg/tree-prof/split-1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ian Lance Taylor June 12, 2017, 2:38 a.m. UTC | #1
On Sun, Jun 11, 2017 at 4:40 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
>
> The new split-1.c testcase fails on targets that do not support split
> stack (like 32-bit PowerPC Linux).  This patch fixes it by only running
> the testcase if split stack is supported.  It also adds the reorder
> flag to the options, so that the test actually tests what it says it
> tests.
>
> Is this okay for trunk?

Whoops, sorry about that.

Adding dg-require-effective-target split_stack is fine.  Adding an
explicit -freorder-blocks-and-partition option is not.  Adding the
explicit option will cause the test to fail when using gold, as the
two options are not compatible.  The point of the test is to test that
using -fsplit-stack disables the default enabling of
-freorder-blocks-and-partition.

Thanks.

Ian

> 2017-06-11  Segher Boessenkool  <segher@kernel.crashing.org>
>
> gcc/testsuite/
>         * gcc.dg/tree-prof/split-1.c: Require effective target split_stack.
>         Add -freorder-blocks-and-partition to options.
>
> ---
>  gcc/testsuite/gcc.dg/tree-prof/split-1.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/testsuite/gcc.dg/tree-prof/split-1.c b/gcc/testsuite/gcc.dg/tree-prof/split-1.c
> index a42fccf..4de1123 100644
> --- a/gcc/testsuite/gcc.dg/tree-prof/split-1.c
> +++ b/gcc/testsuite/gcc.dg/tree-prof/split-1.c
> @@ -1,7 +1,8 @@
>  /* Test case that we don't get a link-time error when using
>     -fsplit-stack with -freorder-blocks-and-partition.  */
> +/* { dg-require-effective-target split_stack } */
>  /* { dg-require-effective-target freorder } */
> -/* { dg-options "-O2 -fsplit-stack" } */
> +/* { dg-options "-O2 -fsplit-stack -freorder-blocks-and-partition" } */
>
>  extern unsigned int sleep (unsigned int);
>
> --
> 1.9.3
>
Segher Boessenkool June 12, 2017, 10:38 a.m. UTC | #2
On Sun, Jun 11, 2017 at 07:38:04PM -0700, Ian Lance Taylor wrote:
> On Sun, Jun 11, 2017 at 4:40 AM, Segher Boessenkool
> <segher@kernel.crashing.org> wrote:
> >
> > The new split-1.c testcase fails on targets that do not support split
> > stack (like 32-bit PowerPC Linux).  This patch fixes it by only running
> > the testcase if split stack is supported.  It also adds the reorder
> > flag to the options, so that the test actually tests what it says it
> > tests.
> >
> > Is this okay for trunk?
> 
> Whoops, sorry about that.
> 
> Adding dg-require-effective-target split_stack is fine.  Adding an
> explicit -freorder-blocks-and-partition option is not.  Adding the
> explicit option will cause the test to fail when using gold, as the
> two options are not compatible.  The point of the test is to test that
> using -fsplit-stack disables the default enabling of
> -freorder-blocks-and-partition.

Ah, I see.  Could you change the comment then, to say what we are
really testing?

> >  /* Test case that we don't get a link-time error when using
> >     -fsplit-stack with -freorder-blocks-and-partition.  */

> >  /* { dg-require-effective-target freorder } */

And this line isn't required, in that case -- removing it is less
confusing and allows the test to run in more places ;-)

[ Paul Hua sent a patch adding split_stack already, it was OKed, but
it is not committed yet, fwiw ].


Segher
Paul Hua June 12, 2017, 11:08 a.m. UTC | #3
>
> [ Paul Hua sent a patch adding split_stack already, it was OKed, but
> it is not committed yet, fwiw ].
>

I saw this, so not commit my patch.

Paul.
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/tree-prof/split-1.c b/gcc/testsuite/gcc.dg/tree-prof/split-1.c
index a42fccf..4de1123 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/split-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/split-1.c
@@ -1,7 +1,8 @@ 
 /* Test case that we don't get a link-time error when using
    -fsplit-stack with -freorder-blocks-and-partition.  */
+/* { dg-require-effective-target split_stack } */
 /* { dg-require-effective-target freorder } */
-/* { dg-options "-O2 -fsplit-stack" } */
+/* { dg-options "-O2 -fsplit-stack -freorder-blocks-and-partition" } */
 
 extern unsigned int sleep (unsigned int);