brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 07077ff Raw
72 lines · plain
1! RUN: %flang_fc1 -fdebug-pre-fir-tree %s | FileCheck %s2 3! Test Pre-FIR Tree captures all the coarray related statements4 5! CHECK: Subroutine test_coarray6Subroutine test_coarray7  use iso_fortran_env, only: team_type, event_type, lock_type8  save9  type(team_type) :: t10  type(event_type) :: done[*]11  type(lock_type) :: alock[*]12  real :: y[10,*]13  integer :: counter[*]14  logical :: is_square15  ! CHECK: <<ChangeTeamConstruct>>16  change team(t, x[5,*] => y)17    ! CHECK: AssignmentStmt18    x = x[4, 1]19  end team20  ! CHECK: <<End ChangeTeamConstruct>>21  ! CHECK: FormTeamStmt22  form team(1, t)23 24  ! CHECK: <<IfConstruct>>25  if (this_image() == 1) then26    ! CHECK: EventPostStmt27    event post (done)28  else29    ! CHECK: EventWaitStmt30    event wait (done)31  end if32  ! CHECK: <<End IfConstruct>>33 34  ! CHECK: <<CriticalConstruct>>35  critical36    ! CHECK: AssignmentStmt37    counter[1] = counter[1] + 138  end critical39  ! CHECK: <<End CriticalConstruct>>40 41  ! CHECK: LockStmt42  lock(alock)43  ! CHECK: PrintStmt44  print *, "I have the lock"45  ! CHECK: UnlockStmt46  unlock(alock)47 48  ! CHECK: SyncAllStmt49  sync all50  ! CHECK: SyncMemoryStmt51  sync memory52  ! CHECK: SyncTeamStmt53  sync team(t)54 55  ! CHECK: <<IfConstruct>>56  if (this_image() == 1) then57    ! CHECK: SyncImagesStmt58    sync images(*)59  else60    ! CHECK: SyncImagesStmt61    sync images(1)62  end if63  ! CHECK: <<End IfConstruct>>64 65  ! CHECK: <<IfConstruct!>>66  if (y<0.) then67    ! CHECK: FailImageStmt68   fail image69  end if70  ! CHECK: <<End IfConstruct!>>71end72