2 ! { dg-options "-fcoarray=lib -fdump-tree-original" }
4 ! Test that the compiler generates sync_all statements only at the required
5 ! locations. This program is not supposed to run (allocating already alloced).
7 program test_alloc_sync
10 integer, allocatable
:: i
13 type(T
), allocatable
:: o
[:]
16 integer, allocatable
:: caf
[:]
20 allocate(caf
[*]) ! implicit sync_all
21 allocate(obj
%i
) ! asynchronous
22 allocate(cafcomp
%o
[*]) ! sync
23 allocate(cafcomp
%o
%i
) ! async
25 allocate(obj
%i
, cafcomp
%o
%i
) ! async
26 allocate(caf
[*], obj
%i
, cafcomp
%o
%i
) ! sync
28 end program test_alloc_sync
30 ! { dg-final { scan-tree-dump-times "caf_sync_all" 3 "original" } }