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

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 !
kono
parents:
diff changeset
3 ! PR 78848: [OOP] ICE on writing CLASS variable with non-typebound DTIO procedure
kono
parents:
diff changeset
4 !
kono
parents:
diff changeset
5 ! Contributed by Mikael Morin <morin-mikael@orange.fr>
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 module m
kono
parents:
diff changeset
8 type :: t
kono
parents:
diff changeset
9 integer :: i = 123
kono
parents:
diff changeset
10 end type
kono
parents:
diff changeset
11 interface write(formatted)
kono
parents:
diff changeset
12 procedure wf
kono
parents:
diff changeset
13 end interface
kono
parents:
diff changeset
14 contains
kono
parents:
diff changeset
15 subroutine wf(this, unit, b, c, iostat, iomsg)
kono
parents:
diff changeset
16 class(t), intent(in) :: this
kono
parents:
diff changeset
17 integer, intent(in) :: unit
kono
parents:
diff changeset
18 character, intent(in) :: b
kono
parents:
diff changeset
19 integer, intent(in) :: c(:)
kono
parents:
diff changeset
20 integer, intent(out) :: iostat
kono
parents:
diff changeset
21 character, intent(inout) :: iomsg
kono
parents:
diff changeset
22 write (unit, "(i3)", IOSTAT=iostat, IOMSG=iomsg) this%i
kono
parents:
diff changeset
23 end subroutine
kono
parents:
diff changeset
24 end
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 program p
kono
parents:
diff changeset
27 use m
kono
parents:
diff changeset
28 character(3) :: buffer
kono
parents:
diff changeset
29 class(t), allocatable :: z
kono
parents:
diff changeset
30 allocate(z)
kono
parents:
diff changeset
31 write(buffer,"(DT)") z
kono
parents:
diff changeset
32 if (buffer /= "123") call abort()
kono
parents:
diff changeset
33 end