Bootstrapping GCC (c, c++) on ia64 w/o support for LTO ([1]) showed that
the testsuite (specifically c-c++-common/guality) executes tests with
`-flto` although there was no support for LTO configured.
[1]: https://gcc.gnu.org/pipermail/gcc-testresults/2025-December/865397.html
This is because [...]/guality.exp adds test permutations w/`-flto`
unconditionally. Fix that by checking for LTO support and drop
permutations w/`-flto` if unsupported.
Fixes
r10-2142-gec8ac265ff21fb as per [2].
[2]: https://gcc.gnu.org/pipermail/gcc-patches/2026-January/705638.html
gcc/testsuite/ChangeLog:
* gcc.dg/guality/guality.exp: Only test with LTO if supported.
* g++.dg/guality/guality.exp: Likewise.
Signed-off-by: Frank Scheiner <frank.scheiner@web.de>
gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] "" ""
gcc-dg-runtest $general "" ""
+
+ if [check_effective_target_lto] {
+ set lto_option_list [list "-Og -flto"]
+ } else {
+ set lto_option_list ""
+ }
+
set-torture-options \
[list "-O0" "-Og"] \
[list {}] \
- [list "-Og -flto"]
+ $lto_option_list
gcc-dg-runtest $Og "" ""
}
gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] "" ""
gcc-dg-runtest $general "" "-Wc++-compat"
+
+ if [check_effective_target_lto] {
+ set lto_option_list [list "-Og -flto"]
+ } else {
+ set lto_option_list ""
+ }
+
set-torture-options \
[list "-O0" "-Og"] \
[list {}] \
- [list "-Og -flto"]
+ $lto_option_list
gcc-dg-runtest $Og "" "-Wc++-compat"
}