This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [google] Fixing function patching tests (issue5626049)


ok for google branches.

David

On Fri, Feb 3, 2012 at 3:20 PM, Harshit Chopra <harshit@google.com> wrote:
> Fixes the following tests by restricting them to 64-bit target environment.
>
> Tested: Using 'make -k check-gcc RUNTESTFLAGS="i386.exp=patch* --target_board=unix\{-m32,,-m64\}"' and crosstool-validate.py script.
>
> Patch to be applied to google/main branch.
>
> 2012-02-03 ? Harshit Chopra ?<harshit@google.com>
>
> ?Restricting the tests to run for 64-bit target since function patching
> ?is only supported for 64-bit targets.
>
> ? ? ? ?* gcc/testsuite/gcc.target/i386/patch-functions-1.c:
> ? ? ? ?* gcc/testsuite/gcc.target/i386/patch-functions-2.c:
> ? ? ? ?* gcc/testsuite/gcc.target/i386/patch-functions-3.c:
> ? ? ? ?* gcc/testsuite/gcc.target/i386/patch-functions-4.c:
> ? ? ? ?* gcc/testsuite/gcc.target/i386/patch-functions-5.c:
> ? ? ? ?* gcc/testsuite/gcc.target/i386/patch-functions-6.c:
> ? ? ? ?* gcc/testsuite/gcc.target/i386/patch-functions-7.c:
>
> diff --git a/gcc/testsuite/gcc.target/i386/patch-functions-1.c b/gcc/testsuite/gcc.target/i386/patch-functions-1.c
> index 1d88d45..308e8c3 100644
> --- a/gcc/testsuite/gcc.target/i386/patch-functions-1.c
> +++ b/gcc/testsuite/gcc.target/i386/patch-functions-1.c
> @@ -1,5 +1,6 @@
> ?/* Verify -mpatch-functions-for-instrumentation works. ?*/
> -/* { dg-do run} */
> +/* { dg-do run } */
> +/* { dg-require-effective-target lp64 } */
> ?/* { dg-options "-mpatch-functions-for-instrumentation" } */
>
> ?/* Check nop-bytes at beginning. ?*/
> diff --git a/gcc/testsuite/gcc.target/i386/patch-functions-2.c b/gcc/testsuite/gcc.target/i386/patch-functions-2.c
> index ed6e7ce..6baad32 100644
> --- a/gcc/testsuite/gcc.target/i386/patch-functions-2.c
> +++ b/gcc/testsuite/gcc.target/i386/patch-functions-2.c
> @@ -1,4 +1,5 @@
> -/* { dg-do run} */
> +/* { dg-do run } */
> +/* { dg-require-effective-target lp64 } */
> ?/* { dg-options "-mpatch-functions-for-instrumentation -mno-patch-functions-main-always" } */
>
> ?/* Function is small to be instrumented with default values. Check there
> diff --git a/gcc/testsuite/gcc.target/i386/patch-functions-3.c b/gcc/testsuite/gcc.target/i386/patch-functions-3.c
> index d7449c5..49b57a8 100644
> --- a/gcc/testsuite/gcc.target/i386/patch-functions-3.c
> +++ b/gcc/testsuite/gcc.target/i386/patch-functions-3.c
> @@ -1,4 +1,5 @@
> -/* { dg-do run} */
> +/* { dg-do run } */
> +/* { dg-require-effective-target lp64 } */
> ?/* { dg-options "-mpatch-functions-for-instrumentation --param function-patch-min-instructions=0" } */
>
> ?/* Function should have nop-bytes with -mpatch-function-min-instructions=0.
> diff --git a/gcc/testsuite/gcc.target/i386/patch-functions-4.c b/gcc/testsuite/gcc.target/i386/patch-functions-4.c
> index f554d92..5fcbd0f 100644
> --- a/gcc/testsuite/gcc.target/i386/patch-functions-4.c
> +++ b/gcc/testsuite/gcc.target/i386/patch-functions-4.c
> @@ -1,4 +1,5 @@
> -/* { dg-do run} */
> +/* { dg-do run } */
> +/* { dg-require-effective-target lp64 } */
> ?/* { dg-options "-mpatch-functions-for-instrumentation -mpatch-functions-ignore-loops -mno-patch-functions-main-always" } */
>
> ?/* Function is too small to be patched when ignoring the loop.
> diff --git a/gcc/testsuite/gcc.target/i386/patch-functions-5.c b/gcc/testsuite/gcc.target/i386/patch-functions-5.c
> index bd1dafb..1f9cccf 100644
> --- a/gcc/testsuite/gcc.target/i386/patch-functions-5.c
> +++ b/gcc/testsuite/gcc.target/i386/patch-functions-5.c
> @@ -1,4 +1,5 @@
> -/* { dg-do run} */
> +/* { dg-do run } */
> +/* { dg-require-effective-target lp64 } */
> ?/* { dg-options "-mpatch-functions-for-instrumentation -mpatch-functions-ignore-loops --param function-patch-min-instructions=0" } */
>
> ?/* Function should be patched with nop bytes with given options.
> diff --git a/gcc/testsuite/gcc.target/i386/patch-functions-6.c b/gcc/testsuite/gcc.target/i386/patch-functions-6.c
> index 46b715d..5bf844f 100644
> --- a/gcc/testsuite/gcc.target/i386/patch-functions-6.c
> +++ b/gcc/testsuite/gcc.target/i386/patch-functions-6.c
> @@ -1,4 +1,5 @@
> -/* { dg-do run} */
> +/* { dg-do run } */
> +/* { dg-require-effective-target lp64 } */
> ?/* { dg-options "-mpatch-functions-for-instrumentation" } */
>
> ?/* 'main' function should always be patched, irrespective of how small it is.
> diff --git a/gcc/testsuite/gcc.target/i386/patch-functions-7.c b/gcc/testsuite/gcc.target/i386/patch-functions-7.c
> index adeda59..e2c50a0 100644
> --- a/gcc/testsuite/gcc.target/i386/patch-functions-7.c
> +++ b/gcc/testsuite/gcc.target/i386/patch-functions-7.c
> @@ -1,4 +1,5 @@
> -/* { dg-do run} */
> +/* { dg-do run } */
> +/* { dg-require-effective-target lp64 } */
> ?/* { dg-options "-mpatch-functions-for-instrumentation -mno-patch-functions-main-always" } */
>
> ?/* 'main' shouldn't be patched with the option -mno-patch-functions-main-always.
>
> --
> This patch is available for review at http://codereview.appspot.com/5626049


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]