2 ! { dg-additional-sources value_4.c }
3 ! { dg-options "-ff2c -w -O0" }
5 ! Tests the functionality of the patch for PR29642, which requested the
6 ! implementation of the F2003 VALUE attribute for gfortran, by calling
7 ! external C functions by value and by reference. This is effectively
8 ! identical to c_by_val_1.f, which does the same for %VAL.
10 ! Contributed by Paul Thomas <pault@gcc.gnu.org>
14 module procedure deltai
, deltar
, deltac
16 real(4) :: epsi
= epsilon (1.0_4
)
18 function deltai (a
, b
) result (c
)
24 function deltar (a
, b
) result (c
)
27 c
= (abs (a
-b
) > epsi
)
30 function deltac (a
, b
) result (c
)
33 c
= ((abs (real (a
-b
)) > epsi
).or
.(abs (aimag (a
-b
)) > epsi
))
40 function f_to_f (x
, y
)
41 real(4), pointer :: f_to_f
48 function i_to_i (x
, y
)
49 integer(4), pointer :: i_to_i
56 complex(4) function c_to_c (x
, y
)
70 if (delta ((2.0 * a
), b
)) call abort ()
76 if (delta ((3_4 * i
), j
)) call abort ()
82 if (delta ((4.0 * u
), v
)) call abort ()
84 ! { dg-final { cleanup-modules "global" } }