Added a test case from a PR that was fixed by something else.
authorThomas König <tkoenig@gcc.gnu.org>
Sun, 12 Apr 2020 15:02:08 +0000 (17:02 +0200)
committerThomas König <tkoenig@gcc.gnu.org>
Sun, 12 Apr 2020 15:05:34 +0000 (17:05 +0200)
2020-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/94091
* gfortran.dg/char_length_22.f90: New test.

Committed ChangeLog entry.

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/char_length_22.f90 [new file with mode: 0644]

index a5e8e6b3c0ca743ff9ffe372d081e94064b69fcc..1343b8bec0672406ac159da9ab65b00f35456512 100644 (file)
@@ -1,3 +1,8 @@
+2020-04-12  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/94091
+       * gfortran.dg/char_length_22.f90: New test.
+
 2020-04-12  Iain Sandoe  <iain@sandoe.co.uk>
 
        * gcc.target/i386/indirect-thunk-1.c: Adjust for fno-common
diff --git a/gcc/testsuite/gfortran.dg/char_length_22.f90 b/gcc/testsuite/gfortran.dg/char_length_22.f90
new file mode 100644 (file)
index 0000000..7df8546
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! { dg-options "-O -Wall" }
+! PR 94091 - this used to give a bogus warning.
+! Test case by "MikeS".
+program tester
+  character(50) cname,fred
+  fred='1234567890123456789012345678901234567890' ! 40 characters
+  kk=len_trim(fred)
+  cname=fred(5:kk)
+  print *,kk,cname
+end program tester