re PR fortran/20520 (allocatable arrays used uninitialized without a warning)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Wed, 31 Oct 2018 18:35:59 +0000 (18:35 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Wed, 31 Oct 2018 18:35:59 +0000 (18:35 +0000)
2018-10-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/20520
* gfortran.dg/allocatable_uninitialized_1.f90: New test.

From-SVN: r265698

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

index 7ba5ea3c39d5619a4bffaddda6a8efed447ec2f6..157b588863725ae8203ea1663904d694572dc152 100644 (file)
@@ -1,3 +1,8 @@
+2018-10-31  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/20520
+       * gfortran.dg/allocatable_uninitialized_1.f90: New test.
+
 2018-10-31  Nathan Sidwell  <nathan@acm.org>
 
        * g++.dg/lookup/friend21.C: New.
diff --git a/gcc/testsuite/gfortran.dg/allocatable_uninitialized_1.f90 b/gcc/testsuite/gfortran.dg/allocatable_uninitialized_1.f90
new file mode 100644 (file)
index 0000000..4c52bd7
--- /dev/null
@@ -0,0 +1,8 @@
+! { dg-do compile }
+! { dg-options "-O -Wall" }
+program main
+  real,allocatable:: a(:),b(:)
+
+   a(1)=2*b(1) ! { dg-warning "uninitialized" }
+
+end