gcov: Respect tripplet when looking for gcov

Message ID 20220909102707.2557434-1-torbjorn.svensson@foss.st.com
State New, archived
Headers
Series gcov: Respect tripplet when looking for gcov |

Commit Message

Torbjorn SVENSSON Sept. 9, 2022, 10:27 a.m. UTC
  When testing a cross toolchain outside the build tree, the binary name
for gcov is prefixed with the tripplet.

gcc/testsuite/ChangeLog:

        * g++.dg/gcov/gcov.exp: Respect tripplet when looking for gcov
        * gcc.misc-tests/gcov.exp: Likewise

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 gcc/testsuite/g++.dg/gcov/gcov.exp    | 4 ++--
 gcc/testsuite/gcc.misc-tests/gcov.exp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
  

Comments

Martin Liška Sept. 9, 2022, 11:46 a.m. UTC | #1
On 9/9/22 12:27, Torbjörn SVENSSON wrote:
> When testing a cross toolchain outside the build tree, the binary name
> for gcov is prefixed with the tripplet.

Ok, thanks!

Martin

> 
> gcc/testsuite/ChangeLog:
> 
>         * g++.dg/gcov/gcov.exp: Respect tripplet when looking for gcov
>         * gcc.misc-tests/gcov.exp: Likewise
> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
> ---
>  gcc/testsuite/g++.dg/gcov/gcov.exp    | 4 ++--
>  gcc/testsuite/gcc.misc-tests/gcov.exp | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/gcc/testsuite/g++.dg/gcov/gcov.exp b/gcc/testsuite/g++.dg/gcov/gcov.exp
> index 88acd95c361..04e7a016486 100644
> --- a/gcc/testsuite/g++.dg/gcov/gcov.exp
> +++ b/gcc/testsuite/g++.dg/gcov/gcov.exp
> @@ -24,9 +24,9 @@ global GXX_UNDER_TEST
>  
>  # Find gcov in the same directory as $GXX_UNDER_TEST.
>  if { ![is_remote host] && [string match "*/*" [lindex $GXX_UNDER_TEST 0]] } {
> -    set GCOV [file dirname [lindex $GXX_UNDER_TEST 0]]/gcov
> +    set GCOV [file dirname [lindex $GXX_UNDER_TEST 0]]/[transform gcov]
>  } else {
> -    set GCOV gcov
> +    set GCOV [transform gcov]
>  }
>  
>  # Initialize harness.
> diff --git a/gcc/testsuite/gcc.misc-tests/gcov.exp b/gcc/testsuite/gcc.misc-tests/gcov.exp
> index 82376d90ac2..a55ce234f6e 100644
> --- a/gcc/testsuite/gcc.misc-tests/gcov.exp
> +++ b/gcc/testsuite/gcc.misc-tests/gcov.exp
> @@ -24,9 +24,9 @@ global GCC_UNDER_TEST
>  
>  # For now find gcov in the same directory as $GCC_UNDER_TEST.
>  if { ![is_remote host] && [string match "*/*" [lindex $GCC_UNDER_TEST 0]] } {
> -    set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/gcov
> +    set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/[transform gcov]
>  } else {
> -    set GCOV gcov
> +    set GCOV {transform gcov]
>  }
>  
>  # Initialize harness.
  
Rainer Orth Sept. 9, 2022, 11:56 a.m. UTC | #2
Hi Torbjörn,

> When testing a cross toolchain outside the build tree, the binary name
> for gcov is prefixed with the tripplet.

here and below: the beast is called triplet.

> gcc/testsuite/ChangeLog:
>
>         * g++.dg/gcov/gcov.exp: Respect tripplet when looking for gcov
>         * gcc.misc-tests/gcov.exp: Likewise

	Rainer
  

Patch

diff --git a/gcc/testsuite/g++.dg/gcov/gcov.exp b/gcc/testsuite/g++.dg/gcov/gcov.exp
index 88acd95c361..04e7a016486 100644
--- a/gcc/testsuite/g++.dg/gcov/gcov.exp
+++ b/gcc/testsuite/g++.dg/gcov/gcov.exp
@@ -24,9 +24,9 @@  global GXX_UNDER_TEST
 
 # Find gcov in the same directory as $GXX_UNDER_TEST.
 if { ![is_remote host] && [string match "*/*" [lindex $GXX_UNDER_TEST 0]] } {
-    set GCOV [file dirname [lindex $GXX_UNDER_TEST 0]]/gcov
+    set GCOV [file dirname [lindex $GXX_UNDER_TEST 0]]/[transform gcov]
 } else {
-    set GCOV gcov
+    set GCOV [transform gcov]
 }
 
 # Initialize harness.
diff --git a/gcc/testsuite/gcc.misc-tests/gcov.exp b/gcc/testsuite/gcc.misc-tests/gcov.exp
index 82376d90ac2..a55ce234f6e 100644
--- a/gcc/testsuite/gcc.misc-tests/gcov.exp
+++ b/gcc/testsuite/gcc.misc-tests/gcov.exp
@@ -24,9 +24,9 @@  global GCC_UNDER_TEST
 
 # For now find gcov in the same directory as $GCC_UNDER_TEST.
 if { ![is_remote host] && [string match "*/*" [lindex $GCC_UNDER_TEST 0]] } {
-    set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/gcov
+    set GCOV [file dirname [lindex $GCC_UNDER_TEST 0]]/[transform gcov]
 } else {
-    set GCOV gcov
+    set GCOV {transform gcov]
 }
 
 # Initialize harness.