testsuite: Fix many UNRESOLVEDs for gcc.dg/vect

Message ID mptim4ydmhr.fsf@arm.com
State New
Headers show
Series
  • testsuite: Fix many UNRESOLVEDs for gcc.dg/vect
Related show

Commit Message

Paul Richard Thomas via Gcc-patches April 7, 2021, 5:37 p.m.
It turns out that, on targets that use testglue, many gcc.dg/vect
scan-assembler tests became UNRESOLVED after the change to the dump
file naming scheme.

The problem is that, when creating an executable, we normally name
the dump file after both the executable and the source file name.
However, as an exception, we name it after only the source file
name if:

(a) there is only one source file name and
(b) the source file and the executable have the same basename

Both (a) and (b) are normally true when building executables from
gcc.dg/vect.  But (a) is not true when linking against testglue.
The harness was therefore looking for a dump file based only on the
source file name while the compiler was producing a dump file that
contained both names.

We get around this for dg-additional-sources using:

	# This option restores naming of aux and dump output files
	# after input files when multiple input files are named,
	# instead of getting them combined with the output name.
	lappend options "additional_flags=-dumpbase \"\""

This patch does the same thing for executables that are linked
against testglue.  This removes over 2400 UNRESOLVEDs from an
armeb-eabi test run, but in so doing introduces FAILs for some
tests that were previously skipped.

Tested on armeb-eabi.  OK to install?

Richard


gcc/testsuite/
	* lib/gcc.exp (gcc_target_compile): Add -dumpbase ""
	when building an executable with testglue.
---
 gcc/testsuite/lib/gcc.exp | 3 +++
 1 file changed, 3 insertions(+)

Comments

Paul Richard Thomas via Gcc-patches April 7, 2021, 6:41 p.m. | #1
On April 7, 2021 7:37:36 PM GMT+02:00, Richard Sandiford via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>It turns out that, on targets that use testglue, many gcc.dg/vect

>scan-assembler tests became UNRESOLVED after the change to the dump

>file naming scheme.

>

>The problem is that, when creating an executable, we normally name

>the dump file after both the executable and the source file name.

>However, as an exception, we name it after only the source file

>name if:

>

>(a) there is only one source file name and

>(b) the source file and the executable have the same basename

>

>Both (a) and (b) are normally true when building executables from

>gcc.dg/vect.  But (a) is not true when linking against testglue.

>The harness was therefore looking for a dump file based only on the

>source file name while the compiler was producing a dump file that

>contained both names.

>

>We get around this for dg-additional-sources using:

>

>	# This option restores naming of aux and dump output files

>	# after input files when multiple input files are named,

>	# instead of getting them combined with the output name.

>	lappend options "additional_flags=-dumpbase \"\""

>

>This patch does the same thing for executables that are linked

>against testglue.  This removes over 2400 UNRESOLVEDs from an

>armeb-eabi test run, but in so doing introduces FAILs for some

>tests that were previously skipped.

>

>Tested on armeb-eabi.  OK to install?


Ok. 

Richard. 

>Richard

>

>

>gcc/testsuite/

>	* lib/gcc.exp (gcc_target_compile): Add -dumpbase ""

>	when building an executable with testglue.

>---

> gcc/testsuite/lib/gcc.exp | 3 +++

> 1 file changed, 3 insertions(+)

>

>diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp

>index dda4d0e6366..4d80606d386 100644

>--- a/gcc/testsuite/lib/gcc.exp

>+++ b/gcc/testsuite/lib/gcc.exp

>@@ -134,6 +134,9 @@ proc gcc_target_compile { source dest type options

>} {

> 	    [info exists gluefile] } {

> 	lappend options "libs=${gluefile}"

> 	lappend options "ldflags=$wrap_flags"

>+	if { $type == "executable" } {

>+	    set options [concat "{additional_flags=-dumpbase \"\"}" $options]

>+	}

>     }

> 

>     global TEST_EXTRA_LIBS

Patch

diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp
index dda4d0e6366..4d80606d386 100644
--- a/gcc/testsuite/lib/gcc.exp
+++ b/gcc/testsuite/lib/gcc.exp
@@ -134,6 +134,9 @@  proc gcc_target_compile { source dest type options } {
 	    [info exists gluefile] } {
 	lappend options "libs=${gluefile}"
 	lappend options "ldflags=$wrap_flags"
+	if { $type == "executable" } {
+	    set options [concat "{additional_flags=-dumpbase \"\"}" $options]
+	}
     }
 
     global TEST_EXTRA_LIBS