1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check errors on MAX/MIN with keywords, a weird case in Fortran
3 real :: x
= 0.0, y
= 0.0 , y1
= 0.0 ! prevent folding
4 !ERROR: Argument keyword 'a1=' was repeated in call to 'max'
5 print *, max(a1
=x
,a1
=1)
6 !ERROR: Keyword argument 'a1=' has already been specified positionally (#1) in this procedure reference
8 print *, max(a1
=x
,a2
=0,a4
=0) ! ok
9 print *, max(x
,0,a99
=0) ! ok
10 !ERROR: Argument keyword 'a06=' is not known in call to 'max'
11 print *, max(a1
=x
,a2
=0,a06
=0)
12 !ERROR: missing mandatory 'a2=' argument
13 print *, max(a3
=y
, a1
=x
)
14 !ERROR: missing mandatory 'a1=' argument
15 print *, max(a3
=y
, a2
=x
)
16 !ERROR: missing mandatory 'a1=' and 'a2=' arguments
17 print *, max(a3
=y
, a4
=x
)
18 !ERROR: missing mandatory 'a2=' argument
19 print *, max(y1
, a3
=y
)
20 !ERROR: missing mandatory 'a1=' and 'a2=' arguments
21 print *, max(a9
=x
, a5
=y
, a4
=y1
)
22 !ERROR: missing mandatory 'a2=' argument
24 !ERROR: missing mandatory 'a2=' argument
26 !ERROR: missing mandatory 'a1=' argument
28 !ERROR: missing mandatory 'a1=' and 'a2=' arguments
30 !ERROR: Argument keyword 'a0=' is not known in call to 'max'
32 !ERROR: Argument keyword 'a03=' is not known in call to 'max'
34 !ERROR: Argument keyword 'abad=' is not known in call to 'max'