1! RUN: %S/test_errors.sh %s %t %flang_fc1
2! REQUIRES: shell
3! Check for semantic errors in num_images() function calls
4
5subroutine test
6
7  ! correct calls, should produce no errors
8  print *, num_images()
9  print *, num_images(team_number=1)
10  print *, num_images(1)
11
12  ! incorrectly typed argument
13  ! the error is seen as too many arguments to the num_images() call with no arguments
14  !ERROR: too many actual arguments for intrinsic 'num_images'
15  print *, num_images(3.4)
16
17  ! call with too many arguments
18  !ERROR: too many actual arguments for intrinsic 'num_images'
19  print *, num_images(1, 1)
20
21  ! keyword argument with incorrect type
22  !ERROR: unknown keyword argument to intrinsic 'num_images'
23  print *, num_images(team_number=3.4)
24
25  ! incorrect keyword argument
26  !ERROR: unknown keyword argument to intrinsic 'num_images'
27  print *, num_images(team_numbers=1)
28
29  !TODO: test num_images() calls related to team_type argument
30
31end subroutine
32