summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocatable_scalar_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/allocatable_scalar_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/allocatable_scalar_1.f9018
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/allocatable_scalar_1.f90 b/gcc/testsuite/gfortran.dg/allocatable_scalar_1.f90
new file mode 100644
index 000000000..d83d2f7f7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocatable_scalar_1.f90
@@ -0,0 +1,18 @@
+! { dg-do run }
+!
+! PR 40996: [F03] ALLOCATABLE scalars
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+implicit none
+real, allocatable :: scalar
+
+allocate(scalar)
+scalar = exp(1.)
+print *,scalar
+if (.not. allocated(scalar)) call abort()
+deallocate(scalar)
+if (allocated(scalar)) call abort()
+
+end
+