[gdb/testsuite] Add testcase for DW_AT_count referencing a variable
Clang describes the upper bounds of variable length arrays using
a DW_AT_count attribute which references the DIE of a synthetic
variable whose value is specified using a DW_AT_location. GDB handles
these incorrectly if the corresponding DWARF expression finishes with a
DW_OP_stack_value (PR26905). This commit adds a new kfailed test to
gdb.dwarf2/count.exp with the same DWARF as that generated by Clang for
gdb.base/vla-optimized-out.exp, one of the failing tests.
Checked on Fedora 32 x86_64, with GCC and Clang.
gdb/testsuite/ChangeLog:
2020-11-22 Gary Benson <gbenson@redhat.com>
PR gdb/26905
* gdb.dwarf2/count.exp: Add test for an array whose upper bound
is defined using a DW_AT_count which references another DIE.