diff mbox

[GOOGLE] Fix new tests

Message ID CAAe5K+XNJ3uO-vgHmkUzQ5ndVbzbYU=Gt=o0FGQr1hAt9+m4wg@mail.gmail.com
State New
Headers show

Commit Message

Teresa Johnson Sept. 24, 2014, 1:20 p.m. UTC
The new tests added for -mpatch-functions-for-instrumentation did not
correctly restrict themselves to x86_64 since tree-prof.exp doesn't
support dg-do. Work around this by using target selectors on the
dg-options. I apply the -mpatch and related options only if it is
x86_64, otherwise it simply does splitting.

Ok for google branches?

Teresa

2014-09-24  Teresa Johnson  <tejohnson@google.com>

        * testsuite/gcc.dg/tree-prof/cold_partition_patch.c:
        * testsuite/g++.dg/tree-prof/partition_patch.C:

Comments

Xinliang David Li Sept. 24, 2014, 3:23 p.m. UTC | #1
not sure if there is a better way, but ok.

David

On Wed, Sep 24, 2014 at 6:20 AM, Teresa Johnson <tejohnson@google.com> wrote:
> The new tests added for -mpatch-functions-for-instrumentation did not
> correctly restrict themselves to x86_64 since tree-prof.exp doesn't
> support dg-do. Work around this by using target selectors on the
> dg-options. I apply the -mpatch and related options only if it is
> x86_64, otherwise it simply does splitting.
>
> Ok for google branches?
>
> Teresa
>
> 2014-09-24  Teresa Johnson  <tejohnson@google.com>
>
>         * testsuite/gcc.dg/tree-prof/cold_partition_patch.c:
>         * testsuite/g++.dg/tree-prof/partition_patch.C:
>
> Index: testsuite/gcc.dg/tree-prof/cold_partition_patch.c
> ===================================================================
> --- testsuite/gcc.dg/tree-prof/cold_partition_patch.c   (revision 215525)
> +++ testsuite/gcc.dg/tree-prof/cold_partition_patch.c   (working copy)
> @@ -1,8 +1,7 @@
>  /* Check if patching works with function splitting. */
> -/* { dg-do compile { target x86_64-*-* } } */
>  /* { dg-require-effective-target freorder } */
> -/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps
> -mpatch-functions-for-instrumentation -fno-optimize-sibling-calls " }
> */
> -
> +/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps " {
> target { ! x86_64-*-* } } }
> +/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps
> -mpatch-functions-for-instrumentation -fno-optimize-sibling-calls " {
> target x86_64-*-* } } */
>  #define SIZE 10000
>
>  const char *sarr[SIZE];
> Index: testsuite/g++.dg/tree-prof/partition_patch.C
> ===================================================================
> --- testsuite/g++.dg/tree-prof/partition_patch.C        (revision 215525)
> +++ testsuite/g++.dg/tree-prof/partition_patch.C        (working copy)
> @@ -1,7 +1,7 @@
>  // Check if patching works with function splitting.
> -// { dg-do compile { target x86_64-*-* } }
>  // { dg-require-effective-target freorder }
> -// { dg-options "-O2 -fnon-call-exceptions
> -freorder-blocks-and-partition -mpatch-functions-for-instrumentation
> -fno-optimize-sibling-calls " }
> +// { dg-options "-O2 -fnon-call-exceptions
> -freorder-blocks-and-partition " { target { ! x86_64-*-* } } }
> +// { dg-options "-O2 -fnon-call-exceptions
> -freorder-blocks-and-partition -mpatch-functions-for-instrumentation
> -fno-optimize-sibling-calls " { target x86_64-*-* } }
>
>  int k;
>
>
> --
> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
Teresa Johnson Sept. 24, 2014, 3:29 p.m. UTC | #2
On Wed, Sep 24, 2014 at 8:23 AM, Xinliang David Li <davidxl@google.com> wrote:
> not sure if there is a better way, but ok.

I looked through the documentation and other tests last night, but
couldn't come up with a better way unfortunately.

Teresa

>
> David
>
> On Wed, Sep 24, 2014 at 6:20 AM, Teresa Johnson <tejohnson@google.com> wrote:
>> The new tests added for -mpatch-functions-for-instrumentation did not
>> correctly restrict themselves to x86_64 since tree-prof.exp doesn't
>> support dg-do. Work around this by using target selectors on the
>> dg-options. I apply the -mpatch and related options only if it is
>> x86_64, otherwise it simply does splitting.
>>
>> Ok for google branches?
>>
>> Teresa
>>
>> 2014-09-24  Teresa Johnson  <tejohnson@google.com>
>>
>>         * testsuite/gcc.dg/tree-prof/cold_partition_patch.c:
>>         * testsuite/g++.dg/tree-prof/partition_patch.C:
>>
>> Index: testsuite/gcc.dg/tree-prof/cold_partition_patch.c
>> ===================================================================
>> --- testsuite/gcc.dg/tree-prof/cold_partition_patch.c   (revision 215525)
>> +++ testsuite/gcc.dg/tree-prof/cold_partition_patch.c   (working copy)
>> @@ -1,8 +1,7 @@
>>  /* Check if patching works with function splitting. */
>> -/* { dg-do compile { target x86_64-*-* } } */
>>  /* { dg-require-effective-target freorder } */
>> -/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps
>> -mpatch-functions-for-instrumentation -fno-optimize-sibling-calls " }
>> */
>> -
>> +/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps " {
>> target { ! x86_64-*-* } } }
>> +/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps
>> -mpatch-functions-for-instrumentation -fno-optimize-sibling-calls " {
>> target x86_64-*-* } } */
>>  #define SIZE 10000
>>
>>  const char *sarr[SIZE];
>> Index: testsuite/g++.dg/tree-prof/partition_patch.C
>> ===================================================================
>> --- testsuite/g++.dg/tree-prof/partition_patch.C        (revision 215525)
>> +++ testsuite/g++.dg/tree-prof/partition_patch.C        (working copy)
>> @@ -1,7 +1,7 @@
>>  // Check if patching works with function splitting.
>> -// { dg-do compile { target x86_64-*-* } }
>>  // { dg-require-effective-target freorder }
>> -// { dg-options "-O2 -fnon-call-exceptions
>> -freorder-blocks-and-partition -mpatch-functions-for-instrumentation
>> -fno-optimize-sibling-calls " }
>> +// { dg-options "-O2 -fnon-call-exceptions
>> -freorder-blocks-and-partition " { target { ! x86_64-*-* } } }
>> +// { dg-options "-O2 -fnon-call-exceptions
>> -freorder-blocks-and-partition -mpatch-functions-for-instrumentation
>> -fno-optimize-sibling-calls " { target x86_64-*-* } }
>>
>>  int k;
>>
>>
>> --
>> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
diff mbox

Patch

Index: testsuite/gcc.dg/tree-prof/cold_partition_patch.c
===================================================================
--- testsuite/gcc.dg/tree-prof/cold_partition_patch.c   (revision 215525)
+++ testsuite/gcc.dg/tree-prof/cold_partition_patch.c   (working copy)
@@ -1,8 +1,7 @@ 
 /* Check if patching works with function splitting. */
-/* { dg-do compile { target x86_64-*-* } } */
 /* { dg-require-effective-target freorder } */
-/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps
-mpatch-functions-for-instrumentation -fno-optimize-sibling-calls " }
*/
-
+/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps " {
target { ! x86_64-*-* } } }
+/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps
-mpatch-functions-for-instrumentation -fno-optimize-sibling-calls " {
target x86_64-*-* } } */
 #define SIZE 10000

 const char *sarr[SIZE];
Index: testsuite/g++.dg/tree-prof/partition_patch.C
===================================================================
--- testsuite/g++.dg/tree-prof/partition_patch.C        (revision 215525)
+++ testsuite/g++.dg/tree-prof/partition_patch.C        (working copy)
@@ -1,7 +1,7 @@ 
 // Check if patching works with function splitting.
-// { dg-do compile { target x86_64-*-* } }
 // { dg-require-effective-target freorder }
-// { dg-options "-O2 -fnon-call-exceptions
-freorder-blocks-and-partition -mpatch-functions-for-instrumentation
-fno-optimize-sibling-calls " }
+// { dg-options "-O2 -fnon-call-exceptions
-freorder-blocks-and-partition " { target { ! x86_64-*-* } } }
+// { dg-options "-O2 -fnon-call-exceptions
-freorder-blocks-and-partition -mpatch-functions-for-instrumentation
-fno-optimize-sibling-calls " { target x86_64-*-* } }

 int k;