2 ! { dg-options "-fdump-tree-original -fcoarray=lib" }
6 ! Test that for CAF components _gfortran_caf_deregister is called
7 ! Test that norealloc happens for CAF components during assignment
11 integer, allocatable
:: CAF
[:]
12 integer, allocatable
:: ii
19 if (allocated(x
%caf
)) call abort()
23 ! For comp%ii: End of scope of x + y (2x) and for the LHS of the assignment (1x)
24 ! { dg-final { scan-tree-dump-times "__builtin_free" 3 "original" } }
26 ! For comp%CAF: End of scope of x + y (2x); no LHS freeing for the CAF in assignment
27 ! { dg-final { scan-tree-dump-times "_gfortran_caf_deregister" 2 "original" } }
30 ! { dg-final { scan-tree-dump-times "__builtin_malloc" 1 "original" } }
32 ! But copy "ii" and "CAF":
33 ! { dg-final { scan-tree-dump-times "__builtin_memcpy" 2 "original" } }
35 ! { dg-final { cleanup-tree-dump "original" } }