2 ! { dg-options "-std=f2003 -fall-intrinsics" }
3 ! Tests the functionality of the patch for PR29642, which requested the
4 ! implementation of the F2003 VALUE attribute for gfortran.
6 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
14 subroutine typhoo (dt
)
15 type(mytype
), value
:: dt
16 if (dtne (dt
, mytype (42.0, "lmno"))) call abort ()
17 dt
= mytype (21.0, "wxyz")
18 if (dtne (dt
, mytype (21.0, "wxyz"))) call abort ()
21 logical function dtne (a
, b
)
24 if ((a
%x
/= b
%x
) .or
. (a
%c
/= b
%c
)) dtne
= .TRUE
.
32 character(2) :: c
= "ab"
33 complex(8) :: z
= (-99.0, 199.0)
34 type(mytype
) :: dt
= mytype (42.0, "lmno")
37 if (c
/= "ab") call abort ()
40 if (i
/= 42) call abort ()
43 if (r
/= 42.0) call abort ()
46 if (z
/= (-99.0, 199.0)) call abort ()
49 if (dtne (dt
, mytype (42.0, "lmno"))) call abort ()
52 call foobar (r
*2.0 + 2.0)
56 character(2), value
:: c
57 if (c
/= "ab") call abort ()
59 if (c
/= "cd") call abort ()
63 integer(8), value
:: i
64 if (i
/= 42) call abort ()
66 if (i
/= 99) call abort ()
71 if (r
/= 42.0) call abort ()
73 if (r
/= 99.0) call abort ()
76 subroutine complex_foo (z
)
77 COMPLEX(8), value
:: z
78 if (z
/= (-99.0, 199.0)) call abort ()
80 if (z
/= (77.0, -42.0)) call abort ()
81 end subroutine complex_foo
83 end program test_value