public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: "Thomas König" <tkoenig@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-8288] Split test to remove failing run time test and add check for ICE.
Date: Wed, 27 Apr 2022 16:46:23 +0000 (GMT)	[thread overview]
Message-ID: <20220427164623.C162F3858D28@sourceware.org> (raw)

https://gcc.gnu.org/g:f6541401407b0d09169fd716ab6d5e02c8d60642

commit r12-8288-gf6541401407b0d09169fd716ab6d5e02c8d60642
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date:   Wed Apr 27 18:40:18 2022 +0200

    Split test to remove failing run time test and add check for ICE.
    
    gcc/testsuite/ChangeLog:
    
            PR fortran/70673
            PR fortran/78054
            * gfortran.dg/pr70673.f90: Remove invalid statement.
            * gfortran.dg/pr70673_2.f90: New test to check that
            ICE does not re-appear.

Diff:
---
 gcc/testsuite/gfortran.dg/pr70673.f90   |  1 -
 gcc/testsuite/gfortran.dg/pr70673_2.f90 | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gfortran.dg/pr70673.f90 b/gcc/testsuite/gfortran.dg/pr70673.f90
index fa4bd2fe02b..1449130274b 100644
--- a/gcc/testsuite/gfortran.dg/pr70673.f90
+++ b/gcc/testsuite/gfortran.dg/pr70673.f90
@@ -16,7 +16,6 @@ contains
     a = a(2:3)      ! Make sure that temporary creation is not broken.
     if ((len (a) .ne. 2) .or. (a .ne. "el")) STOP 2
     deallocate (a)
-    a = a           ! This would ICE too.
   end subroutine s
 end module m
 
diff --git a/gcc/testsuite/gfortran.dg/pr70673_2.f90 b/gcc/testsuite/gfortran.dg/pr70673_2.f90
new file mode 100644
index 00000000000..ba2ce2f2a96
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr70673_2.f90
@@ -0,0 +1,25 @@
+! { dg-do compile }
+!
+! Test the fix for PR70673
+!
+! Contributed by David Kinniburgh  <davidgkinniburgh@yahoo.co.uk>
+!
+module m
+contains
+  subroutine s(inp)
+    character(*), intent(in) :: inp
+    character(:), allocatable :: a
+    a = a           ! This used to ICE.
+    a = inp
+    a = a           ! This used to ICE too
+    if ((len (a) .ne. 5) .or. (a .ne. "hello")) STOP 1
+    a = a(2:3)      ! Make sure that temporary creation is not broken.
+    if ((len (a) .ne. 2) .or. (a .ne. "el")) STOP 2
+    deallocate (a)
+    a = a           ! This would ICE too.
+  end subroutine s
+end module m
+
+  use m
+  call s("hello")
+end


                 reply	other threads:[~2022-04-27 16:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20220427164623.C162F3858D28@sourceware.org \
    --to=tkoenig@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).