Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/coarray_allocate_9.f08 @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children | 84e7813d76e9 |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ! { dg-do run } | |
2 ! { dg-options "-fcoarray=lib -lcaf_single" } | |
3 ! { dg-additional-options "-latomic" { target libatomic_available } } | |
4 | |
5 ! Contributed by Damian Rouson | |
6 | |
7 program main | |
8 implicit none | |
9 | |
10 type particles | |
11 real x(2) | |
12 end type | |
13 | |
14 type vector | |
15 type(particles), allocatable :: v(:) | |
16 end type | |
17 | |
18 type(vector) :: outbox[*] | |
19 type(particles), allocatable :: object(:)[:] | |
20 | |
21 allocate(outbox%v(1), source=particles(this_image())) | |
22 | |
23 if (any( outbox[1]%v(1)%x(1:2) /= [ 1.0, 1.0] )) call abort() | |
24 if (any( outbox[1]%v(1)%x(:) /= [ 1.0, 1.0] )) call abort() | |
25 if (any( outbox[1]%v(1)%x /= [ 1.0, 1.0] )) call abort() | |
26 | |
27 allocate(object(1)[*], source=particles(this_image())) | |
28 | |
29 if (any( object(1)[1]%x(1:2) /= [ 1.0, 1.0] )) call abort() | |
30 if (any( object(1)[1]%x(:) /= [ 1.0, 1.0] )) call abort() | |
31 if (any( object(1)[1]%x /= [ 1.0, 1.0] )) call abort() | |
32 end program |