diff mbox series

match ld besides collect2 in gcov test

Message ID ormugakfr5.fsf@lxoliva.fsfla.org
State New
Headers show
Series match ld besides collect2 in gcov test | expand

Commit Message

Alexandre Oliva Aug. 15, 2019, 8:13 a.m. UTC
The regexp that checks that -lgcov is linked in when --coverage is
passed to the compiler driver requires the command line to match
'/collect2'.  Some of our targets don't match that, but they match /ld
or ${target_alias}-ld depending on the testing scenario, so I'd like
to tweak the test to match those as well.

Tested on x86_64-linux-gnu, and on the affected test scenarios.
Ok to install?


for  gcc/testsuite/ChangeLog

	* gcc.misc-tests/options.exp: Match /ld and -ld besides
	/collect2.
---
 gcc/testsuite/gcc.misc-tests/options.exp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jeff Law Aug. 15, 2019, 6:08 p.m. UTC | #1
On 8/15/19 2:13 AM, Alexandre Oliva wrote:
> The regexp that checks that -lgcov is linked in when --coverage is
> passed to the compiler driver requires the command line to match
> '/collect2'.  Some of our targets don't match that, but they match /ld
> or ${target_alias}-ld depending on the testing scenario, so I'd like
> to tweak the test to match those as well.
> 
> Tested on x86_64-linux-gnu, and on the affected test scenarios.
> Ok to install?
> 
> 
> for  gcc/testsuite/ChangeLog
> 
> 	* gcc.misc-tests/options.exp: Match /ld and -ld besides
> 	/collect2.
OK
jeff
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.misc-tests/options.exp b/gcc/testsuite/gcc.misc-tests/options.exp
index 79535238fca8..c50784c84f31 100644
--- a/gcc/testsuite/gcc.misc-tests/options.exp
+++ b/gcc/testsuite/gcc.misc-tests/options.exp
@@ -65,7 +65,8 @@  proc check_for_all_options {language gcc_options compiler_pattern as_pattern ld_
 	fail "$test (assembler options)"
 	return
     }
-    if {![regexp -- "/collect2(\\.exe)? .*$ld_pattern" $gcc_output]} {
+    # Match /collect2, /ld, or *-ld.
+    if {![regexp -- "(/collect2|\[-/\]ld)(\\.exe)? .*$ld_pattern" $gcc_output]} {
 	fail "$test (linker options)"
 	return
     }