]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
options.exp: unsupport tests that depend on missing language
authorAlexandre Oliva <oliva@adacore.com>
Thu, 3 Dec 2020 01:10:26 +0000 (22:10 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Thu, 3 Dec 2020 01:10:26 +0000 (22:10 -0300)
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.

gcc/testsuite/lib/options.exp

index c7f7316943e414462e8a7ae8e2b539b28325f27c..7700144fd440b917218f991c98c6b897517fc90a 100644 (file)
@@ -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 ""