[gdb/testsuite] Check compilation result in gdb.dwarf2/dw2-opt-structptr.exp
authorTom de Vries <tdevries@suse.de>
Thu, 30 Sep 2021 17:07:48 +0000 (19:07 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 30 Sep 2021 17:07:48 +0000 (19:07 +0200)
commit9ebd2909664f80aa669bf3d904a4c809691e3198
treead229b3cca414fb7c7423d54870f06337d129fe1
parentc2fd8824c8ff4a7b48ef9f058be0038d1f6faa1f
[gdb/testsuite] Check compilation result in gdb.dwarf2/dw2-opt-structptr.exp

When running test-case gdb.dwarf2/dw2-opt-structptr.exp with target board
unix/-bad, I get:
...
gdb compile failed, gcc: error: unrecognized command line option '-bad'
UNTESTED: gdb.dwarf2/dw2-opt-structptr.exp: dw2-opt-structptr.exp
UNTESTED: gdb.dwarf2/dw2-opt-structptr.exp: failed to compile
ERROR: (dw2-opt-structptr) No such file or directory
UNRESOLVED: gdb.dwarf2/dw2-opt-structptr.exp: console: set print object on
...

Merge the two UNTESTEDs.

Fix the UNRESOLVED by checking result of compilation.

Tested on x86_64-linux.
gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp