modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / pdt_23.f03
blobb2156b9ce6ee1a4ae78eb614eff763b57460ad32
1 ! { dg-do run }
3 ! Tests the fixes for PR82719 and PR82720.
5 ! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
7 program p
8    character(120) :: buffer
9    character(3) :: chr
10    integer :: i
11    type t(a)
12       integer, len :: a
13       character(len=a) :: c
14    end type
15    type(t(:)), allocatable :: x
16    allocate (t(2) :: x)
18    x = t(2,'ab')
19    write (buffer, *) x%c ! Tests the fix for PR82720
20    read (buffer, *) chr
21    if (trim (chr) .ne. 'ab') STOP 1
23    x = t(3,'xyz')
24    if (len (x%c) .ne. 3) STOP 2
25    write (buffer, *) x   ! Tests the fix for PR82719
26    read (buffer, *) i, chr
27    if (i .ne. 3) STOP 3
28    if (chr .ne. 'xyz') STOP 4
30    buffer = " 3  lmn"
31    read (buffer, *) x   ! Some thought will be needed for PDT reads.
32    if (x%c .ne. 'lmn') STOP 5
33 end