re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_send_by_ref_1.f08
blob838121ee3a9ebb382d62703f4f6d4d099e8358f7
1 ! { dg-do run }
2 ! { dg-options "-fcoarray=lib -lcaf_single" }
3 ! { dg-additional-options "-latomic" { target libatomic_available } }
5 program check_caf_send_by_ref
7   implicit none
9   type T
10     integer, allocatable :: scal
11     integer, allocatable :: array(:)
12   end type T
14   type(T), save :: obj[*]
15   integer :: me, np, i
17   me = this_image()
18   np = num_images()
20   obj[np]%scal = 42
22   ! Check the token for the scalar is set.
23   if (obj[np]%scal /= 42) STOP 1
25   ! Now the same for arrays.
26   obj[np]%array = [(i * np + me, i = 1, 15)]
27   if (any(obj[np]%array /= [(i * np + me, i = 1, 15)])) STOP 2
29 end program check_caf_send_by_ref