annotate gcc/testsuite/gfortran.dg/allocate_alloc_opt_11.f90 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! PR fortran/44556
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Contributed by Jonathan Hogg and Steve Kargl.
kono
parents:
diff changeset
6 !
kono
parents:
diff changeset
7 program oh_my
kono
parents:
diff changeset
8 implicit none
kono
parents:
diff changeset
9 type a
kono
parents:
diff changeset
10 integer, allocatable :: b(:), d(:)
kono
parents:
diff changeset
11 character(len=80) :: err
kono
parents:
diff changeset
12 character(len=80), allocatable :: str(:)
kono
parents:
diff changeset
13 integer :: src
kono
parents:
diff changeset
14 end type a
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 integer j
kono
parents:
diff changeset
17 type(a) :: c
kono
parents:
diff changeset
18 c%err = 'ok'
kono
parents:
diff changeset
19 allocate(c%d(1))
kono
parents:
diff changeset
20 allocate(c%b(2), errmsg=c%err, stat=c%d(1)) ! OK
kono
parents:
diff changeset
21 deallocate(c%b, errmsg=c%err, stat=c%d(1)) ! OK
kono
parents:
diff changeset
22 allocate(c%b(2), errmsg=c%err, stat=c%b(1)) ! { dg-error "the same ALLOCATE statement" }
kono
parents:
diff changeset
23 deallocate(c%b, errmsg=c%err, stat=c%b(1)) ! { dg-error "the same DEALLOCATE statement" }
kono
parents:
diff changeset
24 allocate(c%str(2), errmsg=c%str(1), stat=j) ! { dg-error "the same ALLOCATE statement" }
kono
parents:
diff changeset
25 deallocate(c%str, errmsg=c%str(1), stat=j) ! { dg-error "the same DEALLOCATE statement" }
kono
parents:
diff changeset
26 end program oh_my