diff mbox

[2/2,AARCH64] Test case changes: Re: [RFC] [PATCH, AARCH64] : Using standard patterns for stack protection.

Message ID CAJK_mQ28gbxAC__6pE0LRqBQtZMzsrkg74z7cP0+hG_e+OR1Jg@mail.gmail.com
State New
Headers show

Commit Message

Venkataramanan Kumar March 19, 2014, 5:18 p.m. UTC
Hi Marcus,

On 14 March 2014 19:42, Marcus Shawcroft <marcus.shawcroft@gmail.com> wrote:
>>>
>>> Do we need a new effective target test, why is the existing
>>> "fstack_protector" not appropriate?
>>
>> "stack_protector" does a run time test. It failed in cross compilation
>> environment and these are compile only tests.
>
> This works fine in my cross environment, how does yours fail?
>
>
>> Also I thought  richard suggested  me to add a new option for this.
>> ref: http://gcc.gnu.org/ml/gcc-patches/2013-11/msg03358.html
>
> I read that comment to mean use an effective target test instead of
> matching triples. I don't see that re-using an existing effective
> target test contradicts that suggestion.
>
> Looking through the test suite I see that there are:
>
> 6 tests that use dg-do compile with dg-require-effective-target fstack_protector
>
> 4 tests that use dg-do run with dg-require-effective-target fstack_protector
>
> 2 tests that use dg-do run {target native} dg-require-effective-target
> fstack_protector
>
> and finally the 2 tests we are discussing that use dg-compile with a
> triple test.
>
> so there are already tests in the testsuite that use dg-do compile
> with the existing effective target test.
>
> I see no immediately obvious reason why the two tests that require
> target native require the native constraint... but I guess that is a
> different issue.
>

I used the existing dg-require-effective-target check,
"stack_protector" and added it in a separate line.

ChangeLog.

2014-03-19  Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>
        * g++.dg/fstack-protector-strong.C: Add effetive target check for
          stack protection.
        * gcc.dg/fstack-protector-strong.c: Likewise.

These two tests are passing now for aarch64-none-linux-gnu target under QEMU.

Let me know if I can upstream these two patches.

regards,
Venkat.

Comments

Marcus Shawcroft March 19, 2014, 5:58 p.m. UTC | #1
On 19 March 2014 17:18, Venkataramanan Kumar
<venkataramanan.kumar@linaro.org> wrote:

> I used the existing dg-require-effective-target check,
> "stack_protector" and added it in a separate line.
>
> ChangeLog.
>
> 2014-03-19  Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>
>         * g++.dg/fstack-protector-strong.C: Add effetive target check for
>           stack protection.
>         * gcc.dg/fstack-protector-strong.c: Likewise.
>
> These two tests are passing now for aarch64-none-linux-gnu target under QEMU.


Venkat,

I think this change is reasonable (for stage-1) but I'd like one of
the testsuite maintainers to ACK the change.

Cheers
/Marcus
diff mbox

Patch

Index: gcc/testsuite/g++.dg/fstack-protector-strong.C
===================================================================
--- gcc/testsuite/g++.dg/fstack-protector-strong.C	(revision 208609)
+++ gcc/testsuite/g++.dg/fstack-protector-strong.C	(working copy)
@@ -1,7 +1,8 @@ 
 /* Test that stack protection is done on chosen functions. */
 
-/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
+/* { dg-do compile } */
 /* { dg-options "-O2 -fstack-protector-strong" } */
+/* { dg-require-effective-target fstack_protector } */
 
 class A
 {
Index: gcc/testsuite/gcc.dg/fstack-protector-strong.c
===================================================================
--- gcc/testsuite/gcc.dg/fstack-protector-strong.c	(revision 208609)
+++ gcc/testsuite/gcc.dg/fstack-protector-strong.c	(working copy)
@@ -1,7 +1,8 @@ 
 /* Test that stack protection is done on chosen functions. */
 
-/* { dg-do compile { target i?86-*-* x86_64-*-* rs6000-*-* s390x-*-* } } */
+/* { dg-do compile } */
 /* { dg-options "-O2 -fstack-protector-strong" } */
+/* { dg-require-effective-target fstack_protector } */
 
 #include<string.h>