diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/select_type_20.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/select_type_20.f90 | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/select_type_20.f90 b/gcc/testsuite/gfortran.dg/select_type_20.f90 new file mode 100644 index 000000000..a247f7b0c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/select_type_20.f90 @@ -0,0 +1,35 @@ +! { dg-do compile } +! PR fortran/45848 +! PR fortran/47204 +! +! Contributed by Harald Anlauf and Zdenek Sojka +! +module gfcbug111 + implicit none + + type, abstract :: inner_product_class + end type inner_product_class + + type, extends(inner_product_class) :: trivial_inner_product_type + end type trivial_inner_product_type + +contains + + function my_dot_v_v (this,a,b) ! { dg-error "has no IMPLICIT type" } + class(trivial_inner_product_type), intent(in) :: this + class(vector_class), intent(in) :: a,b ! { dg-error "Derived type" } + real :: my_dot_v_v + + select type (a) + class is (trivial_vector_type) ! { dg-error "Syntax error in CLASS IS" } + select type (b) ! { dg-error "Expected TYPE IS" } + class is (trivial_vector_type) ! { dg-error "Syntax error in CLASS IS" } + class default + end select + class default ! { dg-error "Unclassifiable statement" } + end select ! { dg-error "Expecting END FUNCTION" } + end function my_dot_v_v +end module gfcbug111 + +select type (a) +! { dg-excess-errors "Unexpected end of file" } |