binutils-gdb/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
Tom de Vries d1c8a76d05 [gdb/testsuite] Remove hardcoded filenames in gdb.dwarf2/*.exp
There's a common occurance in dwarf assembly test-cases, where a file test.exp
contains:
...
standard_testfile test.c test-dw.S
...

The "test.c" arg can be abbreviated to ".c".

Make standard_testfile treat args with "-" prefix the same as with "." prefix,
such that we can write:
...
standard_testfile .c -dw.S
...
and apply this in gdb.dwarf2/*.exp.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-10-17  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (standard_testfile): Also treat args starting with '-'
	as suffix.
	* gdb.dwarf2/atomic.c: Rename to ...
	* gdb.dwarf2/atomic-type.c: ... this.
	* gdb.dwarf2/dw2-ranges2.c: Rename to ...
	* gdb.dwarf2/dw2-ranges-2.c: ... this.
	* gdb.dwarf2/dw2-ranges3.c: Rename to ...
	* gdb.dwarf2/dw2-ranges-3.c: ... this.
	* gdb.dwarf2/fission-mix2.c: Rename to ...
	* gdb.dwarf2/fission-mix-2.c: ... this.
	* gdb.dwarf2/ada-linkage-name.exp: Use more suffix args for
	standard_testfile.
	* gdb.dwarf2/ada-valprint-error.exp: Same.
	* gdb.dwarf2/arr-stride.exp: Same.
	* gdb.dwarf2/arr-subrange.exp: Same.
	* gdb.dwarf2/atomic-type.exp: Same.
	* gdb.dwarf2/bad-regnum.exp: Same.
	* gdb.dwarf2/break-inline-psymtab.exp: Same.
	* gdb.dwarf2/clang-debug-names-2.exp: Same.
	* gdb.dwarf2/clang-debug-names.exp: Same.
	* gdb.dwarf2/comp-unit-lang.exp: Same.
	* gdb.dwarf2/corrupt.exp: Same.
	* gdb.dwarf2/count.exp: Same.
	* gdb.dwarf2/cpp-linkage-name.exp: Same.
	* gdb.dwarf2/data-loc.exp: Same.
	* gdb.dwarf2/dw2-align.exp: Same.
	* gdb.dwarf2/dw2-bad-elf.exp: Same.
	* gdb.dwarf2/dw2-bad-mips-linkage-name.exp: Same.
	* gdb.dwarf2/dw2-bad-unresolved.exp: Same.
	* gdb.dwarf2/dw2-case-insensitive.exp: Same.
	* gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Same.
	* gdb.dwarf2/dw2-ifort-parameter.exp: Same.
	* gdb.dwarf2/dw2-inline-many-frames.exp: Same.
	* gdb.dwarf2/dw2-inline-param.exp: Same.
	* gdb.dwarf2/dw2-inline-small-func.exp: Same.
	* gdb.dwarf2/dw2-inline-stepping.exp: Same.
	* gdb.dwarf2/dw2-is-stmt-2.exp: Same.
	* gdb.dwarf2/dw2-is-stmt.exp: Same.
	* gdb.dwarf2/dw2-line-number-zero.exp: Same.
	* gdb.dwarf2/dw2-namespaceless-anonymous.exp: Same.
	* gdb.dwarf2/dw2-opt-structptr.exp: Same.
	* gdb.dwarf2/dw2-param-error.exp: Same.
	* gdb.dwarf2/dw2-ranges-base.exp: Same.
	* gdb.dwarf2/dw2-ranges.exp: Same.
	* gdb.dwarf2/dw2-unusual-field-names.exp: Same.
	* gdb.dwarf2/dw2-vendor-extended-opcode.exp: Same.
	* gdb.dwarf2/dw4-sig-types.exp: Same.
	* gdb.dwarf2/dynarr-ptr.exp: Same.
	* gdb.dwarf2/enum-type.exp: Same.
	* gdb.dwarf2/fission-mix.exp: Same.
	* gdb.dwarf2/formdata16.exp: Same.
	* gdb.dwarf2/implptrconst.exp: Same.
	* gdb.dwarf2/implptrpiece.exp: Same.
	* gdb.dwarf2/info-locals-optimized-out.exp: Same.
	* gdb.dwarf2/main-subprogram.exp: Same.
	* gdb.dwarf2/method-ptr.exp: Same.
	* gdb.dwarf2/missing-sig-type.exp: Same.
	* gdb.dwarf2/nonvar-access.exp: Same.
	* gdb.dwarf2/opaque-type-lookup.exp: Same.
	* gdb.dwarf2/shortpiece.exp: Same.
	* gdb.dwarf2/staticvirtual.exp: Same.
	* gdb.dwarf2/subrange.exp: Same.
	* gdb.dwarf2/symtab-producer.exp: Same.
	* gdb.dwarf2/typedef-void-finish.exp: Same.
	* gdb.dwarf2/var-access.exp: Same.
	* gdb.dwarf2/variant.exp: Same.
	* gdb.dwarf2/void-type.exp: Same.
	* gdb.dwarf2/dw2-ranges-psym.exp: Same.  Use main.c instead of
	dw2-ranges-main.c.
	* gdb.dwarf2/dw2-ranges-main.c: Remove.
2020-10-17 00:10:31 +02:00

41 lines
1.2 KiB
Text

# Copyright 2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
load_lib dwarf.exp
# This test can only be run on targets which support DWARF-2 and use gas.
if {![dwarf2_support]} {
return 0
}
standard_testfile .c -debug.S
lassign [function_range main ${srcdir}/${subdir}/${srcfile}] \
main_start main_length
set asm_file [standard_output_file $srcfile2]
source $srcdir/$subdir/clang-debug-names.exp.tcl
if { [prepare_for_testing "failed to prepare" ${testfile} \
[list $srcfile $asm_file] {nodebug}] } {
return -1
}
set cmd "ptype main"
set pass_re \
[multi_line \
$cmd \
"type = int \\(\\)"]
gdb_test $cmd $pass_re