diff options
author | Alexandre Oliva <oliva@adacore.com> | 2020-12-02 22:10:26 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2020-12-02 22:10:26 -0300 |
commit | 93d883c7734d92c021c624d82885d3a46532cf0b (patch) | |
tree | 0ae9eed72ce3bb85cc83fde884d107d6f5bf1345 /gcc | |
parent | 5106ff7e6095a281de4c4eead6a3a69a7c59f882 (diff) | |
download | gcc-93d883c7734d92c021c624d82885d3a46532cf0b.zip gcc-93d883c7734d92c021c624d82885d3a46532cf0b.tar.gz gcc-93d883c7734d92c021c624d82885d3a46532cf0b.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/lib/options.exp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/options.exp b/gcc/testsuite/lib/options.exp index c7f7316..7700144 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 "" |