testsuite: Pattern does not match when using --specs=nano.specs

Message ID 20240206165825.3602755-1-torbjorn.svensson@foss.st.com
State Accepted
Headers
Series testsuite: Pattern does not match when using --specs=nano.specs |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Torbjorn SVENSSON Feb. 6, 2024, 4:58 p.m. UTC
  Ok for trunk and releases/gcc-13?

---

When running the testsuite for newlib nano, the --specs=nano.specs
option is used.  This option prepends cpp_unique_options with
"-isystem =/include/newlib-nano" so that the newlib nano header files
override the newlib standard ones.  As the -isystem option is prepended,
the -quiet option is no longer the first option to cc1.  Adjust the test
accordingly.

Patch has been verified on Windows and Linux.

gcc/testsuite/ChangeLog:

	* gcc.misc-tests/options.exp: Allow other options before the
	-quite option for cc1.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 gcc/testsuite/gcc.misc-tests/options.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Mike Stump Feb. 7, 2024, 6:55 p.m. UTC | #1
On Feb 6, 2024, at 8:58 AM, Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> wrote:
> 
> Ok for trunk and releases/gcc-13?

Ok.  If .* goes across newlines, you might want to not use ..

> -    if {![regexp -- "/${compiler}(\\.exe)? -quiet.*$compiler_pattern" $gcc_output]} {
> +    if {![regexp -- "/${compiler}(\\.exe)? .*-quiet.*$compiler_pattern" $gcc_output]} {
  

Patch

diff --git a/gcc/testsuite/gcc.misc-tests/options.exp b/gcc/testsuite/gcc.misc-tests/options.exp
index ec026ecf77d..e7fcde87585 100644
--- a/gcc/testsuite/gcc.misc-tests/options.exp
+++ b/gcc/testsuite/gcc.misc-tests/options.exp
@@ -57,7 +57,7 @@  proc check_for_all_options {language gcc_options compiler_pattern as_pattern ld_
 	remote_file build delete $dumpfile
     }   
 
-    if {![regexp -- "/${compiler}(\\.exe)? -quiet.*$compiler_pattern" $gcc_output]} {
+    if {![regexp -- "/${compiler}(\\.exe)? .*-quiet.*$compiler_pattern" $gcc_output]} {
 	fail "$test (compiler options)"
 	return
     }