PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / coarray_allocate_9.f08
bloba3deb09679a22769911e1bf2502156e678cdb003
1 ! { dg-do run }
2 ! { dg-options "-fcoarray=lib -lcaf_single" }
3 ! { dg-additional-options "-latomic" { target libatomic_available } }
5 ! Contributed by Damian Rouson
7 program main
8   implicit none
10   type particles
11     real x(2)
12   end type
14   type vector
15     type(particles), allocatable :: v(:)
16   end type
18   type(vector) :: outbox[*]
19   type(particles), allocatable :: object(:)[:]
21   allocate(outbox%v(1), source=particles(this_image()))
23   if (any( outbox[1]%v(1)%x(1:2) /= [ 1.0, 1.0] )) STOP 1
24   if (any( outbox[1]%v(1)%x(:) /= [ 1.0, 1.0] )) STOP 2
25   if (any( outbox[1]%v(1)%x /= [ 1.0, 1.0] )) STOP 3
27   allocate(object(1)[*], source=particles(this_image()))
29   if (any( object(1)[1]%x(1:2) /= [ 1.0, 1.0] )) STOP 4
30   if (any( object(1)[1]%x(:) /= [ 1.0, 1.0] )) STOP 5
31   if (any( object(1)[1]%x /= [ 1.0, 1.0] )) STOP 6
32 end program