[gdb/testsuite] Add untested case in gdb.gdb/complaints.exp
authorTom de Vries <tdevries@suse.de>
Fri, 3 Sep 2021 15:40:10 +0000 (17:40 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 3 Sep 2021 15:40:10 +0000 (17:40 +0200)
commite34a209edf13f64c2b13a79186563a501ee28df5
tree82d65cbbc86da6863035b554f529d051b7efff4d
parent5c177fed07e31081fa88f2dc5ca000363fbb3ad9
[gdb/testsuite] Add untested case in gdb.gdb/complaints.exp

When building gdb with "-Wall -O2 -g -flto=auto", I run into:
...
(gdb) call clear_complaints()^M
No symbol "clear_complaints" in current context.^M
(gdb) FAIL: gdb.gdb/complaints.exp: clear complaints
...

The problem is that lto has optimized away clear_complaints, and consequently
the selftests cannot run.

Fix this by:
- using info function to detect presence of clear_complaints
- handling the absence of clear_complaints by calling untested
...
(gdb) UNTESTED: gdb.gdb/complaints.exp: \
  Cannot find clear_complaints, skipping test
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-09-03  Tom de Vries  <tdevries@suse.de>

* gdb.gdb/complaints.exp: Use untested if clear_complaints cannot
be found.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.gdb/complaints.exp
This page took 0.023947 seconds and 4 git commands to generate.