[gdb/testsuite] Fix gdb.dwarf2/per-bfd-sharing.exp with cc-with-gdb-index
authorTom de Vries <tdevries@suse.de>
Mon, 2 Aug 2021 13:31:51 +0000 (15:31 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 2 Aug 2021 13:31:51 +0000 (15:31 +0200)
commit1df42e90836a542aa16b2f89b22810d264bb3882
tree7993042bcca39b5fabd2a5796fa349da53b15467
parent4d47cbdd29ba8c29876adcbb84dfba9efbd15f5f
[gdb/testsuite] Fix gdb.dwarf2/per-bfd-sharing.exp with cc-with-gdb-index

When running with target board cc-with-gdb-index, we run into:
...
rm: cannot remove '/tmp/tmp.JmYTeiuFjj/*.gdb-index': \
  No such file or directory^M
FAIL: gdb.dwarf2/per-bfd-sharing.exp: \
  couldn't remove files in temporary cache dir
...

Fix this, as in gdb.base/index-cache.exp, by only FAILing when
$expecting_index_cache_use.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

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

* gdb.dwarf2/per-bfd-sharing.exp: Only expect index-cache files
when $expecting_index_cache_use.
gdb/testsuite/gdb.dwarf2/per-bfd-sharing.exp