From: Bernd Edlinger <bernd.edlinger@hotmail.de>
To: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
Mike Stump <mikestump@comcast.net>,
Alexandre Oliva <oliva@adacore.com>,
David Edelsohn <dje.gcc@gmail.com>
Subject: [PATCH] testsuite: Fix test failures from outputs.exp [PR98225]
Date: Thu, 7 Jan 2021 23:18:46 +0100 [thread overview]
Message-ID: <AM0PR0602MB341079EE60B2F32B564658B5E4AF0@AM0PR0602MB3410.eurprd06.prod.outlook.com> (raw)
In-Reply-To: <yddlfd4enfv.fsf@CeBiTec.Uni-Bielefeld.DE>
[-- Attachment #1: Type: text/plain, Size: 1287 bytes --]
Hi,
On 1/7/21 5:12 PM, Rainer Orth wrote:
> The unsetenv needs to be wrapped in
>
> if [info exists env(MAKEFLAGS)] {
>
Done.
> @@ -163,6 +167,9 @@ proc outest { test sources opts dirs out
> if { $ogl != {} } {
> pass "$test: $d$o"
> file delete $ogl
> + } elseif { [string match "*.ld1_args" $o] } {
> + # This file may be missing if !HAVE_GNU_LD
> + pass "$test: $d$o"
>
> Always PASSing the test even if it isn't run is wrong. Either wrap
> the whole group of tests with response files in
>
> if [check_effective_target_gld] {
>
> or make the test for the *.ld1_args file conditional on that
> (e.g. along the lines of $ltop used elsewhere). I'd welcome input
> from Alexandre which is preferred.
>
Ah, yes that is a good idea. Thanks.
I think the .cdtor.* handling, is probably a bad example that I followed here.
I don't know why that is there in the first place, as there
are no C++ test cases, these files should not be created at all.
If they are ever created we would have a couple of other files created
as well IMHO.
If there are still misssing files in some cases,
I'd prefer to track these per test case, instead of globally.
Therefore I propose to remove that exception for now.
Is it OK for trunk?
Thanks
Bernd.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-testsuite-Fix-test-failures-from-outputs.exp-PR98225.patch --]
[-- Type: text/x-patch; name="0001-testsuite-Fix-test-failures-from-outputs.exp-PR98225.patch", Size: 4184 bytes --]
From 9e0fc10b1c655320ccb63c1798141f4a572410f8 Mon Sep 17 00:00:00 2001
From: Bernd Edlinger <bernd.edlinger@hotmail.de>
Date: Thu, 7 Jan 2021 09:37:32 +0100
Subject: [PATCH] testsuite: Fix test failures from outputs.exp [PR98225]
The .ld1_args file is not created when HAVE_GNU_LD is false.
The ltrans0.ltrans_arg file is not created when the make jobserver
is available, so remove the MAKEFLAGS variable.
There are no .cdtor.* files ever created with any of the tests,
so remove the exception for those files.
2021-01-07 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR testsuite/98225
* gcc.misc-tests/outputs.exp: Unset MAKEFLAGS.
Expect .ld1_args only when GNU LD is used.
Remove exception for .cdtor.* files.
---
gcc/testsuite/gcc.misc-tests/outputs.exp | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp b/gcc/testsuite/gcc.misc-tests/outputs.exp
index 80d4b61..05e5b1b2 100644
--- a/gcc/testsuite/gcc.misc-tests/outputs.exp
+++ b/gcc/testsuite/gcc.misc-tests/outputs.exp
@@ -50,6 +50,9 @@ if !$skip_lto {
set ltop [check_linker_plugin_available]
}
+# Check for GNU LD. Some files like .ld1_args depend on this.
+set gld [check_effective_target_gld]
+
# Prepare additional options to be used for linking.
# We do not compile to an executable, because that requires naming an output.
set link_options ""
@@ -67,6 +70,12 @@ if {[board_info $dest exists output_format]} {
append link_options " additional_flags=-Wl,-oformat,[board_info $dest output_format]"
}
+# Avoid possible influence from the make jobserver,
+# otherwise ltrans0.ltrans_args files may be missing.
+if [info exists env(MAKEFLAGS)] {
+ unsetenv MAKEFLAGS
+}
+
# For the test named TEST, run the compiler with SOURCES and OPTS, and
# look in DIRS for OUTPUTS. SOURCES is a list of suffixes for source
# files starting with $b in $srcdir/$subdir, OPTS is a string with
@@ -130,6 +139,7 @@ proc outest { test sources opts dirs outputs } {
foreach og $olist {
if { [string index $og 0] == "!" } {
global gspd ltop
+ global gld
set cond [expr $og]
continue
}
@@ -179,11 +189,7 @@ proc outest { test sources opts dirs outputs } {
set outb {}
foreach f $outs {
file delete $f
- # collect2 may create <execname>.cdtor* files in -save-temps link tests,
- # ??? without regard to aux output naming conventions.
- if ![string match "*.cdtor.*" $f] then {
- lappend outb $f
- }
+ lappend outb $f
}
foreach d $dirs {
file delete -force $d
@@ -285,10 +291,10 @@ outest "$b exe savetmp namedb" $sing "-o $b.exe -save-temps" {} {{--0.i --0.s --
outest "$b exe savetmp named2" $mult "-o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .exe}}
# Additional files are created when an @file is used
-outest "$b exe savetmp namedb" $sing "@/dev/null -o $b.exe -save-temps" {} {{--0.i --0.s --0.o .args.0 .ld1_args .exe}}
-outest "$b exe savetmp named2" $mult "@/dev/null -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .args.0 .ld1_args .exe}}
-outest "$b exe savetmp named2" $mult "@/dev/null -I dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 -args.1 .args.2 .ld1_args .exe}}
-outest "$b exe savetmp named2" $mult "@/dev/null -I dummy -L dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 -args.1 .args.2 .args.3 .ld1_args .exe}}
+outest "$b exe savetmp namedb" $sing "@/dev/null -o $b.exe -save-temps" {} {{--0.i --0.s --0.o .args.0 !!$gld .ld1_args !0 .exe}}
+outest "$b exe savetmp named2" $mult "@/dev/null -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o .args.0 !!$gld .ld1_args !0 .exe}}
+outest "$b exe savetmp named2" $mult "@/dev/null -I dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 -args.1 .args.2 !!$gld .ld1_args !0 .exe}}
+outest "$b exe savetmp named2" $mult "@/dev/null -I dummy -L dummy -o $b.exe -save-temps" {} {{--1.i --1.s --1.o --2.i --2.s --2.o -args.0 -args.1 .args.2 .args.3 !!$gld .ld1_args !0 .exe}}
# Setting the main output to a dir selects it as the default aux&dump
# location.
--
1.9.1
next prev parent reply other threads:[~2021-01-07 22:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-07 8:48 [PATCH] Fix test failures from outputs.exp (PR testsuite/98225) Bernd Edlinger
2021-01-07 16:12 ` Rainer Orth
2021-01-07 22:18 ` Bernd Edlinger [this message]
2021-01-08 8:52 ` [PATCH] testsuite: Fix test failures from outputs.exp [PR98225] Alexandre Oliva
2021-01-11 12:11 ` Rainer Orth
2021-01-08 14:23 ` David Edelsohn
2021-01-08 18:59 ` [PATCH v2] " Bernd Edlinger
2021-01-08 19:27 ` David Edelsohn
2021-01-11 11:13 ` Bernd Edlinger
2021-01-11 12:13 ` Rainer Orth
2021-02-16 1:33 ` Committed: gcc.misc-tests/outputs.exp (outest): Fix typo "is_target" Hans-Peter Nilsson
2021-02-16 7:35 ` Bernd Edlinger
2021-02-16 10:48 ` Hans-Peter Nilsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AM0PR0602MB341079EE60B2F32B564658B5E4AF0@AM0PR0602MB3410.eurprd06.prod.outlook.com \
--to=bernd.edlinger@hotmail.de \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=mikestump@comcast.net \
--cc=oliva@adacore.com \
--cc=ro@CeBiTec.Uni-Bielefeld.DE \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).