1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for semantic errors in this_image() function calls
5 use, intrinsic :: iso_fortran_env
, only
: team_type
6 type(team_type
) :: team
7 !ERROR: Coarray 'coteam' may not have type TEAM_TYPE, C_PTR, or C_FUNPTR
8 type(team_type
) :: coteam
[*]
9 integer :: coscalar
[*], coarray(3)[*]
10 save :: coteam
, coscalar
, coarray
12 ! correct calls, should produce no errors
15 print *, this_image(team
)
16 print *, this_image(coarray
)
17 print *, this_image(coarray
, team
)
18 print *, this_image(coarray
, 1)
19 print *, this_image(coarray
, 1, team
)
20 print *, this_image(coscalar
)
21 print *, this_image(coscalar
, team
)
22 print *, this_image(coscalar
, 1)
23 print *, this_image(coscalar
, 1, team
)
25 !ERROR: 'coarray=' argument must have corank > 0 for intrinsic 'this_image'
26 print *, this_image(array
,1)
28 print *, team_number()
29 print *, team_number(team
)