2 ! Tests the fix for PR31229, PR31154 and PR33334, in which
3 ! the KIND and TYPE parameters in the function declarations
6 ! Contributed by Brooks Moses <brooks@gcc.gnu.org>
7 ! and Tobias Burnus <burnus@gcc.gnu.org>
11 integer, parameter :: dp = selected_real_kind(6)
22 type(t) function func() ! The legal bit of PR33334
27 real(dp) function another_dp_before_defined ()
29 another_dp_before_defined = real (kind (4.0_DP))
34 REAL(2*DP) function declared_dp_before_defined()
37 declared_dp_before_defined = 1.0_dp
39 declared_dp_before_defined = real (kind (x))
45 type(t), external :: func
47 if (kind (y ()) .ne. 4) call abort ()
48 if (kind (declared_dp_before_defined ()) .ne. 8) call abort ()
49 if (int (declared_dp_before_defined ()) .ne. 4) call abort ()
50 if (int (another_dp_before_defined ()) .ne. 4) call abort ()
52 if (z%i .ne. 5) call abort ()
54 ! { dg-final { cleanup-modules "kinds mymodule" } }