2 ! { dg-options "-std=f2003 " }
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"))) STOP 1
17 dt
= mytype (21.0, "wxyz")
18 if (dtne (dt
, mytype (21.0, "wxyz"))) STOP 2
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")
46 if (z
/= (-99.0, 199.0)) STOP 6
49 if (dtne (dt
, mytype (42.0, "lmno"))) STOP 7
52 call foobar (r
*2.0 + 2.0)
56 character(2), value
:: c
63 integer(8), value
:: i
71 if (r
/= 42.0) STOP 12
73 if (r
/= 99.0) STOP 13
76 subroutine complex_foo (z
)
77 COMPLEX(8), value
:: z
78 if (z
/= (-99.0, 199.0)) STOP 14
80 if (z
/= (77.0, -42.0)) STOP 15
81 end subroutine complex_foo
83 end program test_value