summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-20 04:01:32 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-20 04:01:32 +0000
commitf2d27e34f4a0eeb9e3a384d2aac62dddba51dbbd (patch)
tree8c0949aeb572f14df72b982616ce4ed7ff3759a3 /gcc/testsuite/gfortran.dg
parent773ccee521ae391a69d16eed32a740f08ffc9c0f (diff)
downloadgcc-f2d27e34f4a0eeb9e3a384d2aac62dddba51dbbd.tar.gz
2010-07-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/44929 * gfortran.dg/allocate_with_typespec.f90: New test. * gfortran.dg/allocate_derived_1.f90: Update error message. 2010-07-19 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/44929 * fortran/match.c (match_type_spec): Check for derived type before intrinsic types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162325 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_derived_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/allocate_with_typespec.f9038
2 files changed, 39 insertions, 1 deletions
diff --git a/gcc/testsuite/gfortran.dg/allocate_derived_1.f90 b/gcc/testsuite/gfortran.dg/allocate_derived_1.f90
index b9f6d5580a0..08665abb265 100644
--- a/gcc/testsuite/gfortran.dg/allocate_derived_1.f90
+++ b/gcc/testsuite/gfortran.dg/allocate_derived_1.f90
@@ -32,7 +32,7 @@
allocate(t1 :: x(2))
allocate(t2 :: x(3))
allocate(t3 :: x(4))
- allocate(tx :: x(5)) ! { dg-error "is not an accessible derived type" }
+ allocate(tx :: x(5)) ! { dg-error "not a nonprocedure pointer or an allocatable variable" }
allocate(u0 :: x(6)) ! { dg-error "may not be ABSTRACT" }
allocate(v1 :: x(7)) ! { dg-error "is type incompatible with typespec" }
diff --git a/gcc/testsuite/gfortran.dg/allocate_with_typespec.f90 b/gcc/testsuite/gfortran.dg/allocate_with_typespec.f90
new file mode 100644
index 00000000000..686abdb5b1b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/allocate_with_typespec.f90
@@ -0,0 +1,38 @@
+!
+! { dg-do compile }
+!
+! PR fortran/44929
+!
+! The module is contributed by Satish.BD <bdsatish@gmail.com>.
+! The subroutines are from Tobias Burnus and Steve Kargl.
+!
+module temp
+
+ type, abstract :: abst
+ !! empty
+ end type abst
+
+ type, extends(abst) :: real_type
+ !! empty
+ end type real_type
+
+ contains
+
+ function create(name) result(obj)
+ character(len=*), intent(in) :: name
+ class(abst), pointer :: obj
+ allocate(real_type :: obj)
+ end function create
+end module temp
+
+subroutine z
+ real(8), allocatable :: r8
+ allocate(real(kind=8) :: r8)
+end subroutine z
+
+subroutine y
+ real(8), allocatable :: r8
+ allocate(real(8) :: r8)
+end subroutine y
+! { dg-final { cleanup-modules "temp" } }
+