public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Remove hardcoded filenames in gdb.dwarf2/*.exp
@ 2020-10-16 12:40 Tom de Vries
  2020-10-16 21:50 ` Simon Marchi
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2020-10-16 12:40 UTC (permalink / raw)
  To: gdb-patches

Hi,

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.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Remove hardcoded filenames in gdb.dwarf2/*.exp

gdb/testsuite/ChangeLog:

2020-10-16  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.

---
 gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp         |  2 +-
 gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp       |  2 +-
 gdb/testsuite/gdb.dwarf2/arr-stride.exp               |  2 +-
 gdb/testsuite/gdb.dwarf2/arr-subrange.exp             |  2 +-
 gdb/testsuite/gdb.dwarf2/{atomic.c => atomic-type.c}  |  0
 gdb/testsuite/gdb.dwarf2/atomic-type.exp              |  2 +-
 gdb/testsuite/gdb.dwarf2/bad-regnum.exp               |  2 +-
 gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp     |  2 +-
 gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp      |  3 +--
 gdb/testsuite/gdb.dwarf2/clang-debug-names.exp        |  2 +-
 gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp           |  2 +-
 gdb/testsuite/gdb.dwarf2/corrupt.exp                  |  2 +-
 gdb/testsuite/gdb.dwarf2/count.exp                    |  2 +-
 gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp         |  2 +-
 gdb/testsuite/gdb.dwarf2/data-loc.exp                 |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-align.exp                |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp              |  2 +-
 .../gdb.dwarf2/dw2-bad-mips-linkage-name.exp          |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp       |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp     |  2 +-
 .../gdb.dwarf2/dw2-cp-infcall-ref-static.exp          |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp      |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp   |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp         |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp    |  4 ++--
 gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp      |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp            |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp              |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp     |  2 +-
 .../gdb.dwarf2/dw2-namespaceless-anonymous.exp        |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp        |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-param-error.exp          |  2 +-
 .../gdb.dwarf2/{dw2-ranges2.c => dw2-ranges-2.c}      |  0
 .../gdb.dwarf2/{dw2-ranges3.c => dw2-ranges-3.c}      |  0
 gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp          |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-ranges-main.c            | 19 -------------------
 gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp          |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-ranges.exp               |  2 +-
 gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp  |  2 +-
 .../gdb.dwarf2/dw2-vendor-extended-opcode.exp         |  2 +-
 gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp            |  2 +-
 gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp               |  2 +-
 gdb/testsuite/gdb.dwarf2/enum-type.exp                |  2 +-
 .../gdb.dwarf2/{fission-mix2.c => fission-mix-2.c}    |  0
 gdb/testsuite/gdb.dwarf2/fission-mix.exp              |  4 ++--
 gdb/testsuite/gdb.dwarf2/formdata16.exp               |  2 +-
 gdb/testsuite/gdb.dwarf2/implptrconst.exp             |  2 +-
 gdb/testsuite/gdb.dwarf2/implptrpiece.exp             |  2 +-
 .../gdb.dwarf2/info-locals-optimized-out.exp          |  2 +-
 gdb/testsuite/gdb.dwarf2/main-subprogram.exp          |  2 +-
 gdb/testsuite/gdb.dwarf2/method-ptr.exp               |  2 +-
 gdb/testsuite/gdb.dwarf2/missing-sig-type.exp         |  2 +-
 gdb/testsuite/gdb.dwarf2/nonvar-access.exp            |  2 +-
 gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp       |  2 +-
 gdb/testsuite/gdb.dwarf2/shortpiece.exp               |  2 +-
 gdb/testsuite/gdb.dwarf2/staticvirtual.exp            |  2 +-
 gdb/testsuite/gdb.dwarf2/subrange.exp                 |  2 +-
 gdb/testsuite/gdb.dwarf2/symtab-producer.exp          |  2 +-
 gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp      |  2 +-
 gdb/testsuite/gdb.dwarf2/var-access.exp               |  2 +-
 gdb/testsuite/gdb.dwarf2/variant.exp                  |  2 +-
 gdb/testsuite/gdb.dwarf2/void-type.exp                |  2 +-
 gdb/testsuite/lib/gdb.exp                             |  9 ++++++---
 63 files changed, 65 insertions(+), 82 deletions(-)

diff --git a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
index c10a592df7..0b440c8e6d 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
@@ -23,7 +23,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile ada-linkage-name.c ada-linkage-name-debug.S
+standard_testfile .c -debug.S
 
 # Set up the DWARF for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp
index fd0928f610..698562de92 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp
+++ b/gdb/testsuite/gdb.dwarf2/ada-valprint-error.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile ada-valprint-error.c ada-valprint-error-dw.S
+standard_testfile .c -dw.S
 
 # We need to know the size of integer and address types in order
 # to write some of the debugging info we'd like to generate.
diff --git a/gdb/testsuite/gdb.dwarf2/arr-stride.exp b/gdb/testsuite/gdb.dwarf2/arr-stride.exp
index 61c280e4f9..e8bff357b0 100644
--- a/gdb/testsuite/gdb.dwarf2/arr-stride.exp
+++ b/gdb/testsuite/gdb.dwarf2/arr-stride.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile arr-stride.c arr-stride-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/arr-subrange.exp b/gdb/testsuite/gdb.dwarf2/arr-subrange.exp
index 4e355ff5c1..7c8250413b 100644
--- a/gdb/testsuite/gdb.dwarf2/arr-subrange.exp
+++ b/gdb/testsuite/gdb.dwarf2/arr-subrange.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile arr-subrange.c arr-subrange-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/atomic.c b/gdb/testsuite/gdb.dwarf2/atomic-type.c
similarity index 100%
rename from gdb/testsuite/gdb.dwarf2/atomic.c
rename to gdb/testsuite/gdb.dwarf2/atomic-type.c
diff --git a/gdb/testsuite/gdb.dwarf2/atomic-type.exp b/gdb/testsuite/gdb.dwarf2/atomic-type.exp
index 9a44686f43..d28af05d26 100644
--- a/gdb/testsuite/gdb.dwarf2/atomic-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/atomic-type.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile atomic.c atomic-type-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/bad-regnum.exp b/gdb/testsuite/gdb.dwarf2/bad-regnum.exp
index 54eb2eacea..5a4d91d911 100644
--- a/gdb/testsuite/gdb.dwarf2/bad-regnum.exp
+++ b/gdb/testsuite/gdb.dwarf2/bad-regnum.exp
@@ -20,7 +20,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile bad-regnum.c bad-regnum-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp b/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
index 344d7da0d5..552b298fab 100644
--- a/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
+++ b/gdb/testsuite/gdb.dwarf2/break-inline-psymtab.exp
@@ -13,7 +13,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-standard_testfile break-inline-psymtab.c break-inline-psymtab-2.c
+standard_testfile .c -2.c
 
 set sources [list $srcfile $srcfile2]
 if { [prepare_for_testing "failed to prepare" ${testfile} $sources] } {
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
index 43d7801c0d..c5d39ebfb1 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names-2.exp
@@ -20,8 +20,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile clang-debug-names-2.c clang-debug-names-debug-2.S \
-    clang-debug-names-2-foo.c
+standard_testfile .c -debug.S -foo.c
 
 lassign \
     [function_range main \
diff --git a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
index 149c1263c9..9656d7ec1a 100644
--- a/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/clang-debug-names.exp
@@ -20,7 +20,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile clang-debug-names.c clang-debug-names-debug.S
+standard_testfile .c -debug.S
 
 lassign [function_range main ${srcdir}/${subdir}/${srcfile}] \
     main_start main_length
diff --git a/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp b/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
index 162848be94..cb1741fcaf 100644
--- a/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
+++ b/gdb/testsuite/gdb.dwarf2/comp-unit-lang.exp
@@ -25,7 +25,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile .c comp-unit-lang.S
+standard_testfile .c .S
 
 # Assemble the DWARF using CU_LANG as compilation unit's language.
 # Run to a function in that compilation unit and check that GDB
diff --git a/gdb/testsuite/gdb.dwarf2/corrupt.exp b/gdb/testsuite/gdb.dwarf2/corrupt.exp
index 971ec71bb4..d89beb596e 100644
--- a/gdb/testsuite/gdb.dwarf2/corrupt.exp
+++ b/gdb/testsuite/gdb.dwarf2/corrupt.exp
@@ -22,7 +22,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile corrupt.c corrupt.S
+standard_testfile .c .S
 
 # Make the DWARF used for the test.
 #
diff --git a/gdb/testsuite/gdb.dwarf2/count.exp b/gdb/testsuite/gdb.dwarf2/count.exp
index b55a97cec7..5cefb15da4 100644
--- a/gdb/testsuite/gdb.dwarf2/count.exp
+++ b/gdb/testsuite/gdb.dwarf2/count.exp
@@ -22,7 +22,7 @@ if { ![dwarf2_support] } {
     return 0
 }
 
-standard_testfile main.c count.S
+standard_testfile main.c .S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp
index 7ff4938029..f2c88b9b55 100644
--- a/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp
@@ -25,7 +25,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile cpp-linkage-name.c cpp-linkage-name-debug.S
+standard_testfile .c -debug.S
 
 # Set up the DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/data-loc.exp b/gdb/testsuite/gdb.dwarf2/data-loc.exp
index de21dffa1e..ce4062eba3 100644
--- a/gdb/testsuite/gdb.dwarf2/data-loc.exp
+++ b/gdb/testsuite/gdb.dwarf2/data-loc.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile data-loc.c data-loc-dw.S
+standard_testfile .c -dw.S
 
 # We need to know the size of integer and address types in order
 # to write some of the debugging info we'd like to generate.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-align.exp b/gdb/testsuite/gdb.dwarf2/dw2-align.exp
index ef8b52c4f4..640216ae19 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-align.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-align.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile main.c align-dw.S
+standard_testfile main.c -dw.S
 
 # Make some DWARF for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
index f6fe54a634..c06a605e5d 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
@@ -34,7 +34,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile dw2-bad-elf.c dw2-bad-elf-other.S dw2-bad-elf-dwarf.S
+standard_testfile .c -other.S -dwarf.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile3]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
index 986de0c526..238297c76a 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
@@ -20,7 +20,7 @@ if {![dwarf2_support]} {
     return 0  
 }
 
-standard_testfile dw2-bad-mips-linkage-name.c dw2-bad-mips-linkage-name.S
+standard_testfile .c .S
 
 # Set up the DWARF for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp
index 5e22ef3793..44d5faa97b 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp
@@ -20,7 +20,7 @@ if {![dwarf2_support]} {
     return 0  
 }
 
-standard_testfile dw2-bad-unresolved.c dw2-bad-unresolved-2.S
+standard_testfile .c -2.S
 
 # Set up the DWARF for the test.
 # The key part of this is the definition of variable "var" having no location.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp
index 4b56469e62..0be2d89d4f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-case-insensitive.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0  
 }
 
-standard_testfile .c dw2-case-insensitive-debug.S
+standard_testfile .c -debug.S
 
 if [is_ilp32_target] {
     set ptrbits 32
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
index 73f29e0d9d..a4fd4aa92f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-cp-infcall-ref-static.exp
@@ -25,7 +25,7 @@ if {![dwarf2_support]} {
     return 0  
 }
 
-standard_testfile .S dw2-cp-infcall-ref-static-main.c
+standard_testfile .S -main.c
 
 if { [prepare_for_testing "failed to prepare" ${testfile} \
 	  [list $srcfile2 $srcfile] {}] } {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
index 32ae5ed66a..d299dc353f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.exp
@@ -22,7 +22,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile .c dw2-ifort-parameter-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
index e826825eb4..935d519934 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-many-frames.exp
@@ -38,7 +38,7 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile dw2-inline-many-frames.c dw2-inline-many-frames.S
+standard_testfile .c .S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
index 1c1e75619d..ad48588a19 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-param.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0  
 }
 
-standard_testfile .S dw2-inline-param-main.c
+standard_testfile .S -main.c
 
 if { [prepare_for_testing "failed to prepare" "${testfile}" \
 	  [list $srcfile2 $srcfile] {nodebug}] } {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
index 12a60a01ed..69d1c42266 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-small-func.exp
@@ -39,8 +39,8 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile dw2-inline-small-func-lbls.c dw2-inline-small-func.S \
-    dw2-inline-small-func.c dw2-inline-small-func.h
+standard_testfile -lbls.c .S \
+    .c .h
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
index 1632d5e898..24fbb717b2 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-stepping.exp
@@ -38,7 +38,7 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile dw2-inline-stepping.c dw2-inline-stepping.S
+standard_testfile .c .S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
index 745af0409f..b2b4308744 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt-2.exp
@@ -38,7 +38,7 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile dw2-is-stmt-2.c dw2-is-stmt-2.S
+standard_testfile .c .S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
index 62e655a0ee..30045a9be9 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-is-stmt.exp
@@ -38,7 +38,7 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile dw2-is-stmt.c dw2-is-stmt.S
+standard_testfile .c .S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
index 12011b5f9c..164397e81e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-line-number-zero.exp
@@ -29,7 +29,7 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile .c dw2-line-number-zero-dw.S
+standard_testfile .c -dw.S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp
index 5b61a6ba92..a6d9a50028 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp
@@ -21,7 +21,7 @@ if {![dwarf2_support]} {
     return 0  
 }
 
-standard_testfile dw2-namespaceless-anonymous.c dw2-namespaceless-anonymous.S
+standard_testfile .c .S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
index d6e309d0d7..496eddcc86 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
@@ -28,7 +28,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile dw2-opt-structptr.c dw2-opt-structptr-dw.S
+standard_testfile .c -dw.S
 
 # Generate a test program with dwarf information showing the variable
 # 'ptr', a pointer-to-struct, as optimized out.  The dwarf will also
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp b/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp
index 9cf6aa7381..e694fe12e6 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-param-error.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0  
 }
 
-standard_testfile .S dw2-param-error-main.c
+standard_testfile .S -main.c
 
 if { [prepare_for_testing "failed to prepare" "${testfile}" \
 	  [list $srcfile2 $srcfile] {nodebug}] } {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges2.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges-2.c
similarity index 100%
rename from gdb/testsuite/gdb.dwarf2/dw2-ranges2.c
rename to gdb/testsuite/gdb.dwarf2/dw2-ranges-2.c
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges3.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges-3.c
similarity index 100%
rename from gdb/testsuite/gdb.dwarf2/dw2-ranges3.c
rename to gdb/testsuite/gdb.dwarf2/dw2-ranges-3.c
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
index 39281a8857..0d363b1a44 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp
@@ -32,7 +32,7 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile dw2-ranges-base.c dw2-ranges-base-dw.S
+standard_testfile .c -dw.S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-main.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges-main.c
deleted file mode 100644
index 7d23288467..0000000000
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-main.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Copyright 2019-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/>.  */
-
-int main ()
-{
-  return 0;
-}
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
index 7a33e35278..4ced125cd1 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp
@@ -31,7 +31,7 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile dw2-ranges-main.c dw2-ranges-psym.c dw2-ranges-psym-dw.S
+standard_testfile main.c .c -dw.S
 
 # We need to know the size of integer and address types in order to
 # write some of the debugging info we'd like to generate.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
index 05cc4318f3..adddc93ff4 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp
@@ -32,7 +32,7 @@ if !$gcc_compiled {
     return 0  
 }
 
-standard_testfile dw2-ranges.c dw2-ranges2.c dw2-ranges3.c
+standard_testfile .c -2.c -3.c
 set asmfile [standard_output_file ${testfile}.s]
 set asmfile2 [standard_output_file ${testfile}2.s]
 set asmfile3 [standard_output_file ${testfile}3.s]
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp b/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
index fd1ec1e106..1ff7b66587 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
@@ -34,7 +34,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile dw2-unusual-field-names.c dw2-unusual-field-names.S
+standard_testfile .c .S
 set asm_file [standard_output_file $srcfile2]
 
 # We need to know the size of integer and address types in order to
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
index 92db7eaa51..08f0e29b7e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-vendor-extended-opcode.exp
@@ -29,7 +29,7 @@ if !$gcc_compiled {
     return 0
 }
 
-standard_testfile dw2-vendor-extended-opcode.c dw2-vendor-extended-opcode-dw.S
+standard_testfile .c -dw.S
 
 set asm_file [standard_output_file $srcfile2]
 Dwarf::assemble $asm_file {
diff --git a/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp b/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp
index 35579f7b6f..05edca580e 100644
--- a/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw4-sig-types.exp
@@ -15,7 +15,7 @@
 
 # Test dwarf4 signatured types (DW_TAG_type_unit).
 
-standard_testfile .cc dw4-sig-types-b.cc
+standard_testfile .cc -b.cc
 
 # This test is intended for targets which support DWARF-4.
 # Since we pass an explicit -gdwarf-4 -fdebug-types-section to the compiler,
diff --git a/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp b/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
index 2f6b17c6dc..fbbcd3b88d 100644
--- a/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/dynarr-ptr.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile dynarr-ptr.c dynarr-ptr-dw.S
+standard_testfile .c -dw.S
 
 # We need to know the size of integer and address types in order
 # to write some of the debugging info we'd like to generate.
diff --git a/gdb/testsuite/gdb.dwarf2/enum-type.exp b/gdb/testsuite/gdb.dwarf2/enum-type.exp
index d61c145558..0b12d19453 100644
--- a/gdb/testsuite/gdb.dwarf2/enum-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/enum-type.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile main.c enum-type-dw.S
+standard_testfile main.c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/fission-mix2.c b/gdb/testsuite/gdb.dwarf2/fission-mix-2.c
similarity index 100%
rename from gdb/testsuite/gdb.dwarf2/fission-mix2.c
rename to gdb/testsuite/gdb.dwarf2/fission-mix-2.c
diff --git a/gdb/testsuite/gdb.dwarf2/fission-mix.exp b/gdb/testsuite/gdb.dwarf2/fission-mix.exp
index cede8cb84a..d738a03c3f 100644
--- a/gdb/testsuite/gdb.dwarf2/fission-mix.exp
+++ b/gdb/testsuite/gdb.dwarf2/fission-mix.exp
@@ -20,11 +20,11 @@ if ![dwarf2_support] {
     return 0  
 }
 
-standard_testfile fission-mix.c fission-mix2.c
+standard_testfile .c -2.c
 set objfile [standard_output_file ${testfile}.o]
 set objfile2 [standard_output_file ${testfile}2.o]
 
-# Compile fission-mix.c without Fission and fission-mix2.c with Fission.
+# Compile fission-mix.c without Fission and fission-mix-2.c with Fission.
 if { [gdb_compile ${srcdir}/${subdir}/${srcfile} $objfile object {debug}] != "" } {
     return -1
 }
diff --git a/gdb/testsuite/gdb.dwarf2/formdata16.exp b/gdb/testsuite/gdb.dwarf2/formdata16.exp
index 202da0934b..0a664a9b13 100644
--- a/gdb/testsuite/gdb.dwarf2/formdata16.exp
+++ b/gdb/testsuite/gdb.dwarf2/formdata16.exp
@@ -20,7 +20,7 @@ if {![dwarf2_support]} {
     return 0  
 }
 
-standard_testfile .c formdata16-dw.S
+standard_testfile .c -dw.S
 
 # We need to know the endianess in order
 # to write some of the debugging info we'd like to generate.
diff --git a/gdb/testsuite/gdb.dwarf2/implptrconst.exp b/gdb/testsuite/gdb.dwarf2/implptrconst.exp
index dc88e948c9..7de2df452a 100644
--- a/gdb/testsuite/gdb.dwarf2/implptrconst.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptrconst.exp
@@ -22,7 +22,7 @@ if {![dwarf2_support]} {
 
 if { [skip_cplus_tests] } { continue }
 
-standard_testfile .c implptrconst-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/implptrpiece.exp b/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
index c56f550339..200e1e9915 100644
--- a/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptrpiece.exp
@@ -22,7 +22,7 @@ if {![dwarf2_support]} {
 
 if { [skip_cplus_tests] } { continue }
 
-standard_testfile main.c implptrpiece-dw.S
+standard_testfile main.c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
index e270441392..33ce4a0054 100644
--- a/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
+++ b/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
@@ -22,7 +22,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile .c ${gdb_test_file_name}-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
index b0924c8096..e5470ab7cb 100644
--- a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
+++ b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp
@@ -19,7 +19,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile main-subprogram.c enum-type-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/method-ptr.exp b/gdb/testsuite/gdb.dwarf2/method-ptr.exp
index b22ff84e84..6c385118d4 100644
--- a/gdb/testsuite/gdb.dwarf2/method-ptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/method-ptr.exp
@@ -21,7 +21,7 @@ if {![dwarf2_support]} {
 
 if { [skip_cplus_tests] } { continue }
 
-standard_testfile .cc method-ptr-dw.S
+standard_testfile .cc -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp b/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
index f6c682b2cc..56fd91ea4f 100644
--- a/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/missing-sig-type.exp
@@ -21,7 +21,7 @@ if {![dwarf2_support]} {
 
 if { [skip_cplus_tests] } { continue }
 
-standard_testfile main.c missing-sig-type-dw4.S
+standard_testfile main.c -dw4.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/nonvar-access.exp b/gdb/testsuite/gdb.dwarf2/nonvar-access.exp
index 93174657bb..71b726f8f6 100644
--- a/gdb/testsuite/gdb.dwarf2/nonvar-access.exp
+++ b/gdb/testsuite/gdb.dwarf2/nonvar-access.exp
@@ -21,7 +21,7 @@ load_lib dwarf.exp
 
 if {![dwarf2_support]} { return 0 }
 
-standard_testfile main.c nonvar-access-dw.S
+standard_testfile main.c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp b/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
index d383b98dd9..118db2270d 100644
--- a/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
+++ b/gdb/testsuite/gdb.dwarf2/opaque-type-lookup.exp
@@ -22,7 +22,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile opaque-type-lookup.c opaque-type-lookup-1.S opaque-type-lookup-2.c
+standard_testfile .c -1.S -2.c
 
 # Create the DWARF.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/shortpiece.exp b/gdb/testsuite/gdb.dwarf2/shortpiece.exp
index b4321bf8ec..794ed5fd1f 100644
--- a/gdb/testsuite/gdb.dwarf2/shortpiece.exp
+++ b/gdb/testsuite/gdb.dwarf2/shortpiece.exp
@@ -20,7 +20,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile main.c shortpiece-dw.S
+standard_testfile main.c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
index e43da0901d..5676951f67 100644
--- a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
+++ b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp
@@ -21,7 +21,7 @@ if {![dwarf2_support]} {
 
 if { [skip_cplus_tests] } { continue }
 
-standard_testfile main.c staticvirtual-dw.S
+standard_testfile main.c -dw.S
 
 # Make DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/subrange.exp b/gdb/testsuite/gdb.dwarf2/subrange.exp
index c99be95003..e4d36eea6d 100644
--- a/gdb/testsuite/gdb.dwarf2/subrange.exp
+++ b/gdb/testsuite/gdb.dwarf2/subrange.exp
@@ -21,7 +21,7 @@ if {![dwarf2_support]} {
 
 if { [skip_cplus_tests] } { continue }
 
-standard_testfile method-ptr.cc subrange-dw.S
+standard_testfile method-ptr.cc -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/symtab-producer.exp b/gdb/testsuite/gdb.dwarf2/symtab-producer.exp
index 7976b4cd76..0b59567a03 100644
--- a/gdb/testsuite/gdb.dwarf2/symtab-producer.exp
+++ b/gdb/testsuite/gdb.dwarf2/symtab-producer.exp
@@ -24,7 +24,7 @@ if {![dwarf2_support]} {
 # This test can also only be run when we have python support in gdb,
 # but that test can only be done after gdb has started, below.
 
-standard_testfile main.c symtab-producer-dw.S
+standard_testfile main.c -dw.S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp b/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp
index e2b95adefe..b8a1d64d19 100644
--- a/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp
+++ b/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp
@@ -24,7 +24,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile void-type.c typedef-void-finish.S
+standard_testfile void-type.c .S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/var-access.exp b/gdb/testsuite/gdb.dwarf2/var-access.exp
index ad53148840..a669b4c971 100644
--- a/gdb/testsuite/gdb.dwarf2/var-access.exp
+++ b/gdb/testsuite/gdb.dwarf2/var-access.exp
@@ -44,7 +44,7 @@ if { [is_aarch64_target] } {
     return
 }
 
-standard_testfile .c ${gdb_test_file_name}-dw.S
+standard_testfile .c -dw.S
 
 # Make some DWARF for the test.
 
diff --git a/gdb/testsuite/gdb.dwarf2/variant.exp b/gdb/testsuite/gdb.dwarf2/variant.exp
index 0250fafc7f..55b0389bce 100644
--- a/gdb/testsuite/gdb.dwarf2/variant.exp
+++ b/gdb/testsuite/gdb.dwarf2/variant.exp
@@ -23,7 +23,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile .c variant.S
+standard_testfile .c .S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/gdb.dwarf2/void-type.exp b/gdb/testsuite/gdb.dwarf2/void-type.exp
index 4ae00c3d25..0ffba34a18 100644
--- a/gdb/testsuite/gdb.dwarf2/void-type.exp
+++ b/gdb/testsuite/gdb.dwarf2/void-type.exp
@@ -31,7 +31,7 @@ if {![dwarf2_support]} {
     return 0
 }
 
-standard_testfile void-type.c void-type.S
+standard_testfile .c .S
 
 # Make some DWARF for the test.
 set asm_file [standard_output_file $srcfile2]
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index d96515b5b1..f53df59f18 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -5277,7 +5277,7 @@ proc cached_file { filename txt {executable 0}} {
 # Without any arguments, the .exp file's base name is used to
 # compute the source file name.  The ".c" extension is added in this case.
 # If ARGS is not empty, each entry is a source file specification.
-# If the specification starts with a ".", it is treated as a suffix
+# If the specification starts with a "." or "-", it is treated as a suffix
 # to append to the .exp file's base name.
 # If the specification is the empty string, it is treated as if it
 # were ".c".
@@ -5324,8 +5324,11 @@ proc standard_testfile {args} {
 	# Handle an extension.
 	if {$arg == ""} {
 	    set arg $testfile.c
-	} elseif {[string range $arg 0 0] == "."} {
-	    set arg $testfile$arg
+	} else {
+	    set first [string range $arg 0 0]
+	    if { $first == "." || $first == "-" } {
+		set arg $testfile$arg
+	    }
 	}
 
 	set $varname $arg

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][gdb/testsuite] Remove hardcoded filenames in gdb.dwarf2/*.exp
  2020-10-16 12:40 [PATCH][gdb/testsuite] Remove hardcoded filenames in gdb.dwarf2/*.exp Tom de Vries
@ 2020-10-16 21:50 ` Simon Marchi
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi @ 2020-10-16 21:50 UTC (permalink / raw)
  To: Tom de Vries, gdb-patches

On 2020-10-16 8:40 a.m., Tom de Vries wrote:
> Hi,
>
> 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.
>
> Any comments?

I think it makes sense, this LGTM.

Simon

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-16 21:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-16 12:40 [PATCH][gdb/testsuite] Remove hardcoded filenames in gdb.dwarf2/*.exp Tom de Vries
2020-10-16 21:50 ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).