Hi!

On 2021-08-18T16:56:18-0700, "H.J. Lu" <hjl.to...@gmail.com> wrote:
> On Tue, Aug 17, 2021 at 12:01 AM Thomas Schwinge
> <tho...@codesourcery.com> wrote:
>> On 2016-12-14T21:31:05-0500, David Malcolm <dmalc...@redhat.com> wrote:
>> > On Wed, 2016-12-14 at 15:02 +0100, Bernd Schmidt wrote:
>> >> On 12/09/2016 08:32 PM, David Malcolm wrote:
>> >> > Thanks.  Unfortunately, applying the "locate_file" patch
>> >> >   https://gcc.gnu.org/ml/gcc-patches/2016-11/msg01186.html
>> >> > would now introduce a regression in a recently-added test case:
>> >>
>> >> > The problem is that this DejaGnu test case uses -fself-test, and
>> >> > doesn't provide any arguments.  With the locate_file patch, we need to
>> >> > pass the path to $(srcdir)/testsuite/selftests as an argument to -fself
>> >> > -test, and it's not clear to me how to do that sanely in a DejaGnu test
>> >> > case
>>
>> Rather simple, actually -- once you realize how all this works.  ;-)
>>
>> >> > if I pass in a dummy value (like for pr71591.c), then the
>> >> > selftests that use locate_file fail.
>>
>> > I've committed the following updated version to trunk (as r243681).
>> >
>> > Changed in v5:
>> > * disable DejaGnu test for PR 78213
>> >
>> > Successfully bootstrapped&regrtested on x86_64-pc-linux-gnu (with 2 PASS
>> > results converted to 1 UNSUPPORTED in gcc.sum, re gcc.dg/pr78213.c).
>>
>> > --- a/gcc/testsuite/gcc.dg/pr78213.c
>> > +++ b/gcc/testsuite/gcc.dg/pr78213.c
>> > @@ -1,6 +1,13 @@
>> >  /* { dg-do compile } */
>> >  /* { dg-options "-fself-test" } */
>> >
>> > +/* When this test was written -fself-test took no argument, but it
>> > +   has subsequently gained a mandatory argument, giving the path
>> > +   to selftest support files (within the srcdir).
>> > +   It's not clear how to provide this path sanely from
>> > +   within DejaGnu, so for now, this test is disabled.  */
>> > +/* { dg-skip-if "" { *-*-* } } */
>> > +
>> >  /* Verify that -fself-test does not fail on a non empty source.  */
>> >
>> >  int i;                                                                    
>> >       void bar();                                                          
>> >            void foo()
>>
>> OK to push the attached "Restore 'gcc.dg/pr78213.c' testing" to master
>> branch?
>>
>> See 'git grep --cached 'dg-.*options .*\$' -- */testsuite/' for
>> pre-existing '$srcdir' usage in DejaGnu directives.
>
> This caused:
>
> cc1: note: self-tests are not enabled in this build
> FAIL: gcc.dg/pr78213.c -fself-test (test for warnings, line )

Sorry for that.

> on release branches.

Specifically: in '--enable-checking=release' etc. configurations.
(I had done my testing with checking enabled...)

This is, in fact, a problem in the original
r242748 (commit 3615816da830d41f67a5d8955ae588eba7f0b6fb)
"[PR target/78213] Do not ICE on non-empty -fself-test", as made
apparent by recent commit a42467bdb70650cd2f421e67b6c3418f74feaec2
"Restore 'gcc.dg/pr78213.c' testing", after the test case had gotten
disabled in r243681 (commit ecfc21ff34ddc6f8aa517251fb51494c68ff741f)
"Introduce selftest::locate_file" shortly after its original introduction.
(This can be seen in a few <gcc-testresu...@gcc.gnu.org> reports from
back then.)

I've pushed "Fix up 'gcc.dg/pr78213.c' for '--enable-checking=release' etc."
to master branch in commit b7fc42073c04813f6b63e0641d3f6765424857c9,
cherry-picked into releases/gcc-11 branch in
commit 5fb588a677bf34dc864c577ed848405752905b89, releases/gcc-10 branch
in commit ee7502e5fec1a1c0215febfd486a0df9ffaf5692, and releases/gcc-9
branch in commit fc1993af02a3076e91c24f372be1883517453095, see attached.


Grüße
 Thomas


-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 
München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas 
Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht 
München, HRB 106955
>From b7fc42073c04813f6b63e0641d3f6765424857c9 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Thu, 19 Aug 2021 08:25:47 +0200
Subject: [PATCH] Fix up 'gcc.dg/pr78213.c' for '--enable-checking=release'
 etc.

Fix up for r242748 (commit 3615816da830d41f67a5d8955ae588eba7f0b6fb)
"[PR target/78213] Do not ICE on non-empty -fself-test", as made
apparent by recent commit a42467bdb70650cd2f421e67b6c3418f74feaec2
"Restore 'gcc.dg/pr78213.c' testing", after the test case had gotten
disabled in r243681 (commit ecfc21ff34ddc6f8aa517251fb51494c68ff741f)
"Introduce selftest::locate_file" shortly after its original introduction.

	gcc/testsuite/
	PR testsuite/101969
	* gcc.dg/pr78213.c: Fix up for '--enable-checking=release' etc.
---
 gcc/testsuite/gcc.dg/pr78213.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/pr78213.c b/gcc/testsuite/gcc.dg/pr78213.c
index 40dd3c82b60..04bf0381f76 100644
--- a/gcc/testsuite/gcc.dg/pr78213.c
+++ b/gcc/testsuite/gcc.dg/pr78213.c
@@ -8,4 +8,5 @@ int i;
   while (i--)
     bar();
 }
-/* { dg-message "fself\-test: " "-fself-test" { target *-*-* } 0 } */
+
+/* { dg-regexp {^-fself-test: [0-9]+ pass\(es\) in [.0-9]+ seconds$|.*: note: self-tests are not enabled in this build$} } */
-- 
2.30.2

>From 5fb588a677bf34dc864c577ed848405752905b89 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Thu, 19 Aug 2021 08:25:47 +0200
Subject: [PATCH] Fix up 'gcc.dg/pr78213.c' for '--enable-checking=release'
 etc.

Fix up for r242748 (commit 3615816da830d41f67a5d8955ae588eba7f0b6fb)
"[PR target/78213] Do not ICE on non-empty -fself-test", as made
apparent by recent commit a42467bdb70650cd2f421e67b6c3418f74feaec2
"Restore 'gcc.dg/pr78213.c' testing", after the test case had gotten
disabled in r243681 (commit ecfc21ff34ddc6f8aa517251fb51494c68ff741f)
"Introduce selftest::locate_file" shortly after its original introduction.

	gcc/testsuite/
	PR testsuite/101969
	* gcc.dg/pr78213.c: Fix up for '--enable-checking=release' etc.

(cherry picked from commit b7fc42073c04813f6b63e0641d3f6765424857c9)
---
 gcc/testsuite/gcc.dg/pr78213.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/pr78213.c b/gcc/testsuite/gcc.dg/pr78213.c
index 40dd3c82b60..04bf0381f76 100644
--- a/gcc/testsuite/gcc.dg/pr78213.c
+++ b/gcc/testsuite/gcc.dg/pr78213.c
@@ -8,4 +8,5 @@ int i;
   while (i--)
     bar();
 }
-/* { dg-message "fself\-test: " "-fself-test" { target *-*-* } 0 } */
+
+/* { dg-regexp {^-fself-test: [0-9]+ pass\(es\) in [.0-9]+ seconds$|.*: note: self-tests are not enabled in this build$} } */
-- 
2.30.2

>From ee7502e5fec1a1c0215febfd486a0df9ffaf5692 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Thu, 19 Aug 2021 08:25:47 +0200
Subject: [PATCH] Fix up 'gcc.dg/pr78213.c' for '--enable-checking=release'
 etc.

Fix up for r242748 (commit 3615816da830d41f67a5d8955ae588eba7f0b6fb)
"[PR target/78213] Do not ICE on non-empty -fself-test", as made
apparent by recent commit a42467bdb70650cd2f421e67b6c3418f74feaec2
"Restore 'gcc.dg/pr78213.c' testing", after the test case had gotten
disabled in r243681 (commit ecfc21ff34ddc6f8aa517251fb51494c68ff741f)
"Introduce selftest::locate_file" shortly after its original introduction.

	gcc/testsuite/
	PR testsuite/101969
	* gcc.dg/pr78213.c: Fix up for '--enable-checking=release' etc.

(cherry picked from commit b7fc42073c04813f6b63e0641d3f6765424857c9)
---
 gcc/testsuite/gcc.dg/pr78213.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/pr78213.c b/gcc/testsuite/gcc.dg/pr78213.c
index 40dd3c82b60..04bf0381f76 100644
--- a/gcc/testsuite/gcc.dg/pr78213.c
+++ b/gcc/testsuite/gcc.dg/pr78213.c
@@ -8,4 +8,5 @@ int i;
   while (i--)
     bar();
 }
-/* { dg-message "fself\-test: " "-fself-test" { target *-*-* } 0 } */
+
+/* { dg-regexp {^-fself-test: [0-9]+ pass\(es\) in [.0-9]+ seconds$|.*: note: self-tests are not enabled in this build$} } */
-- 
2.30.2

>From fc1993af02a3076e91c24f372be1883517453095 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tho...@codesourcery.com>
Date: Thu, 19 Aug 2021 08:25:47 +0200
Subject: [PATCH] Fix up 'gcc.dg/pr78213.c' for '--enable-checking=release'
 etc.

Fix up for r242748 (commit 3615816da830d41f67a5d8955ae588eba7f0b6fb)
"[PR target/78213] Do not ICE on non-empty -fself-test", as made
apparent by recent commit a42467bdb70650cd2f421e67b6c3418f74feaec2
"Restore 'gcc.dg/pr78213.c' testing", after the test case had gotten
disabled in r243681 (commit ecfc21ff34ddc6f8aa517251fb51494c68ff741f)
"Introduce selftest::locate_file" shortly after its original introduction.

	gcc/testsuite/
	PR testsuite/101969
	* gcc.dg/pr78213.c: Fix up for '--enable-checking=release' etc.

(cherry picked from commit b7fc42073c04813f6b63e0641d3f6765424857c9)
---
 gcc/testsuite/gcc.dg/pr78213.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/pr78213.c b/gcc/testsuite/gcc.dg/pr78213.c
index 40dd3c82b60..04bf0381f76 100644
--- a/gcc/testsuite/gcc.dg/pr78213.c
+++ b/gcc/testsuite/gcc.dg/pr78213.c
@@ -8,4 +8,5 @@ int i;
   while (i--)
     bar();
 }
-/* { dg-message "fself\-test: " "-fself-test" { target *-*-* } 0 } */
+
+/* { dg-regexp {^-fself-test: [0-9]+ pass\(es\) in [.0-9]+ seconds$|.*: note: self-tests are not enabled in this build$} } */
-- 
2.30.2

Reply via email to