2 ! { dg-options "-fdec -fcheck=all" }
4 ! Verify that -fdec does not break parsing of PDTs.
5 ! This test code is copied from pdt_1.f03 but compiled with -fdec.
9 integer, parameter :: ftype = kind(0.0e0)
10 integer :: pdt_len = 4
13 integer, kind :: a = kind(0.0d0)
16 real(kind = a) :: d(b, b)
17 character (len = b*b) :: chr
20 type(mytype(b=4)) :: z(2)
21 type(mytype(ftype, 4)) :: z2
25 z(1)%d = reshape ([(real(i), i = 1, 16)],[4,4])
27 z(1)%chr = "hello pdt"
28 z(2)%chr = "goodbye pdt"
30 z2%d = z(1)%d * 10 - 1
37 elemental subroutine foo (arg)
38 type(mytype(8,*)), intent(in) :: arg
39 if (arg%i .eq. 1) then
40 if (trim (arg%chr) .ne. "hello pdt") error stop
41 if (int (sum (arg%d)) .ne. 136) error stop
42 else if (arg%i .eq. 2 ) then
43 if (trim (arg%chr) .ne. "goodbye pdt") error stop
44 if (int (sum (arg%d)) .ne. 1360) error stop
50 type(mytype(b=4)) :: arg(:)
51 if (int (sum (arg(1)%d)) .ne. 136) call abort
52 if (trim (arg(2)%chr) .ne. "goodbye pdt") call abort
54 subroutine foobar (arg)
55 type(mytype(ftype, pdt_len)) :: arg
56 if (int (sum (arg%d)) .ne. 1344) call abort
57 if (trim (arg%chr) .ne. "scalar pdt") call abort