diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/alloc_alloc_expr_3.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/alloc_alloc_expr_3.f90 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/alloc_alloc_expr_3.f90 b/gcc/testsuite/gfortran.dg/alloc_alloc_expr_3.f90 new file mode 100644 index 000000000..13b2230c0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/alloc_alloc_expr_3.f90 @@ -0,0 +1,25 @@ +! { dg-do compile } +! +! PR fortran/34714 - ICE on invalid +! Testcase contributed by Martin Reinecke <martin AT mpa-garching DOT mpg DOT de> +! + +module foo + type bar + logical, pointer, dimension(:) :: baz + end type +contains + +function func1() + type(bar) func1 + allocate(func1%baz(1)) +end function + +function func2() + type(bar) func2 + allocate(func1%baz(1)) ! { dg-error "is not a variable" } +end function + +end module foo + +! { dg-final { cleanup-modules "foo" } } |