[gdb/testsuite] Fix gdb.base/index-cache.exp with cc-with-gdb-index
authorTom de Vries <tdevries@suse.de>
Sun, 1 Aug 2021 17:53:42 +0000 (19:53 +0200)
committerTom de Vries <tdevries@suse.de>
Sun, 1 Aug 2021 17:53:42 +0000 (19:53 +0200)
commitaf51804103a08cd1e12edc4f4a30eec2c5c4f9e8
treee9e9d8e63dc1f59b5017a8bf2a35068267ae16dd
parent426260d246c9cc0bb9ac5af7216748b38c2c1179
[gdb/testsuite] Fix gdb.base/index-cache.exp with cc-with-gdb-index

With target board cc-with-gdb-index we run into:
...
FAIL: gdb.base/index-cache.exp: couldn't remove files in temporary cache dir
...

The problem is that there are no files to remove, because the index cache
isn't used, as indicated by $expecting_index_cache_use.

Fix this by only FAILing when $expecting_index_cache_use.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-08-01  Tom de Vries  <tdevries@suse.de>

* gdb.base/index-cache.exp:
gdb/testsuite/gdb.base/index-cache.exp