! { dg-do compile }
! { dg-option "-fdump-tree-original }
!
! PR fortran/18918
!
! Check of critcal block translations
!
subroutine test(j)
integer :: i, j
i = 5
critical
  i = 10
  sync memory ! FIXME: See trans-stm.c's gfc_trans_sync_memory()
end critical
if (i /= 10) call abort()
sync all
j = 5
end subroutine test

program main
 integer :: a
 integer, allocatable :: b(:)[:,:]
 a = -43
 call test(a)
 if (a /= 5) call abort()
end program main
! { FIXME-dg-final { scan-tree-dump-times "_gfortran_flush" 1 "original" } }
! { dg-final { cleanup-tree-dump "original" } }

