Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / call23.f90
blob2e33cb092df432e2b6d1fe9da323cd0e3137df5c
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
7 print *, max(x,a1=1)
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
23 print *, max(x)
24 !ERROR: missing mandatory 'a2=' argument
25 print *, max(a1=x)
26 !ERROR: missing mandatory 'a1=' argument
27 print *, max(a2=y)
28 !ERROR: missing mandatory 'a1=' and 'a2=' arguments
29 print *, max(a3=x)
30 !ERROR: Argument keyword 'a0=' is not known in call to 'max'
31 print *, max(a0=x)
32 !ERROR: Argument keyword 'a03=' is not known in call to 'max'
33 print *, max(a03=x)
34 !ERROR: Argument keyword 'abad=' is not known in call to 'max'
35 print *, max(abad=x)
36 end