aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2019-11-23 15:19:19 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2019-11-23 15:19:19 +0000
commit5cebf730684f709c2e39911be5f5b0c8967d78c0 (patch)
tree7d24b177d2572a230b2080f69d7f56a7a90fce38
parent1e83bd7003e03160b7d71fb959111e89b53446ab (diff)
downloadgcc-5cebf730684f709c2e39911be5f5b0c8967d78c0.zip
gcc-5cebf730684f709c2e39911be5f5b0c8967d78c0.tar.gz
gcc-5cebf730684f709c2e39911be5f5b0c8967d78c0.tar.bz2
Add test case for PR 92442.
2019-11-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/92442 * gfortran.dg/bounds_check_21.f90: New test. From-SVN: r278647
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/bounds_check_21.f9012
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7687fcc..b63a038 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-23 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/92442
+ * gfortran.dg/bounds_check_21.f90: New test.
+
2019-11-23 Jan Hubicka <hubicka@ucw.cz>
* g++.dg/tree-ssa/pr53844.C: Drop -O2 from param name.
diff --git a/gcc/testsuite/gfortran.dg/bounds_check_21.f90 b/gcc/testsuite/gfortran.dg/bounds_check_21.f90
new file mode 100644
index 0000000..181d623
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/bounds_check_21.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! { dg-options "-Warray-bounds -O2" }
+! PR 92422 - this complained about an array subscript out of bounds.
+
+PROGRAM character_warning
+
+ CHARACTER(len=16) :: word
+
+ word = 'hi'
+ WRITE(*,*) word
+
+END PROGRAM character_warning