Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / this_image01.f90
blob0e59aa3fa27c6b61bc813cc91c411ee130e5bd1d
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for semantic errors in this_image() function calls
4 subroutine test
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
13 team = get_team()
14 print *, this_image()
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)
31 end subroutine