From: Alexandre Oliva Date: Thu, 3 Dec 2020 01:10:26 +0000 (-0300) Subject: options.exp: unsupport tests that depend on missing language X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93d883c7734d92c021c624d82885d3a46532cf0b;p=gcc.git options.exp: unsupport tests that depend on missing language There's a help.exp test that checks that the help message for -Wabsolute-value mentions it's available in C and ObjC, when compiling a C++ program. However, if GCC is built with the C++ language disabled, the .cc file is compiled as C, and the message [available in C...] becomes [disabled] instead, because that's the default for the flag in C. I suppose it might also be possible to disable the C language, and then the multitude of help.exp tests that name c as the source language will fail. This patch avoids these fails: it detects the message "compiler not installed" in the compiler output, and bails out as "unsupported". for gcc/testsuite/ChangeLog * lib/options.exp (check_for_options_with_filter): Detect unavailable compiler for the selected language, and bail out as unsupported. --- diff --git a/gcc/testsuite/lib/options.exp b/gcc/testsuite/lib/options.exp index c7f7316943e..7700144fd44 100644 --- a/gcc/testsuite/lib/options.exp +++ b/gcc/testsuite/lib/options.exp @@ -59,6 +59,11 @@ proc check_for_options_with_filter { language gcc_options exclude \ set gcc_output [gcc_target_compile $srcfname $filebase.x executable $gcc_options] remote_file build delete $srcfname $filebase.x $filebase.gcno + if {[regexp -- "compiler not installed on this system" $gcc_output]} { + unsupported "$test: $language compiler not available" + return + } + if { $exclude != "" } { set lines [split $gcc_output "\n"] set gcc_output ""