1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for semantic errors in num_images() function calls
5 use iso_fortran_env
, only
: team_type
8 type(team_type
) my_team
10 ! correct calls, should produce no errors
12 print *, num_images(team_number
=1)
13 print *, num_images(1)
14 print *, num_images(my_team
)
15 print *, num_images(team
=my_team
)
17 ! incorrectly typed argument
18 ! the error is seen as too many arguments to the num_images() call with no arguments
19 !ERROR: too many actual arguments for intrinsic 'num_images'
20 print *, num_images(3.4)
22 ! call with too many arguments
23 !ERROR: too many actual arguments for intrinsic 'num_images'
24 print *, num_images(1, 1)
26 ! keyword argument with incorrect type
27 !ERROR: unknown keyword argument to intrinsic 'num_images'
28 print *, num_images(team_number
=3.4)
30 ! incorrect keyword argument
31 !ERROR: unknown keyword argument to intrinsic 'num_images'
32 print *, num_images(team_numbers
=1)
34 !ERROR: unknown keyword argument to intrinsic 'num_images'
35 print *, num_images(teams
=my_team
)