1 ! RUN: %python %S/test_errors.py %s %flang_fc1
5 character(len
=len
) :: ch
8 impure
real function f1(x
,y
)
13 real, intent(in
) :: x
, y
16 pure
real function f3(x
,y
,z
)
17 real, intent(in
) :: x
, y
, z
20 pure
real function f4(x
,y
)
22 pure
real function x(); end function
23 pure
real function y(); end function
27 pure
integer function f5(x
,y
)
28 real, intent(in
) :: x
, y
31 pure
real function f6(x
,y
)
32 real, intent(in
) :: x(*), y(*)
35 pure
real function f7(x
,y
)
36 real, intent(in
), allocatable
:: x
40 pure
real function f8(x
,y
)
41 real, intent(in
), pointer :: x
45 pure
real function f9(x
,y
)
46 real, intent(in
), optional
:: x
50 pure
real function f10(x
,y
)
51 real, intent(in
), target
:: x
55 pure
function f11(x
,y
) result(res
)
56 type(pdt(*)), intent(in
) :: x
, y
57 type(pdt(max(x
%len
, y
%len
))) :: res
63 !ERROR: OPERATION= argument of REDUCE() must be a pure function of two data arguments
65 !ERROR: OPERATION= argument of REDUCE() must be a scalar function
67 !ERROR: OPERATION= argument of REDUCE() must be a pure function of two data arguments
69 !ERROR: OPERATION= argument of REDUCE() may not have dummy procedure arguments
71 !ERROR: OPERATION= argument of REDUCE() must have the same type as ARRAY=
73 !ERROR: Arguments of OPERATION= procedure of REDUCE() must be both scalar of the same type as ARRAY=, and neither allocatable, pointer, polymorphic, or optional
75 !ERROR: Arguments of OPERATION= procedure of REDUCE() must be both scalar of the same type as ARRAY=, and neither allocatable, pointer, polymorphic, or optional
77 !ERROR: Arguments of OPERATION= procedure of REDUCE() must be both scalar of the same type as ARRAY=, and neither allocatable, pointer, polymorphic, or optional
79 !ERROR: Arguments of OPERATION= procedure of REDUCE() must be both scalar of the same type as ARRAY=, and neither allocatable, pointer, polymorphic, or optional
81 !ERROR: If either argument of the OPERATION= procedure of REDUCE() has the ASYNCHRONOUS, VOLATILE, or TARGET attribute, both must have that attribute
85 type(pdt(10)) :: a(10), b
86 b
= reduce(a
, f11
) ! check no bogus type incompatibility diagnostic