summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/allocate_alloc_opt_5.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/allocate_alloc_opt_5.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_alloc_opt_5.f9015
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/allocate_alloc_opt_5.f90 b/gcc/testsuite/gfortran.dg/allocate_alloc_opt_5.f90
new file mode 100644
index 000000000..d7e3ea93f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_alloc_opt_5.f90
@@ -0,0 +1,15 @@
+! { dg-do compile }
+! { dg-options "-std=f95" }
+program a
+
+ implicit none
+
+ integer n
+ character(len=70) str
+ integer, allocatable :: i(:)
+
+ n = 42
+ allocate(i(4), source=n) ! { dg-error "Fortran 2003: SOURCE tag" }
+ allocate(i(4), stat=n, errmsg=str) ! { dg-error "Fortran 2003: ERRMSG tag" }
+
+end program a