Skip to content

Commit 0c55821

Browse files
author
Damian Rouson
committed
adjust co_broadcast_derived... test for GCC < 8
1 parent b5e80d8 commit 0c55821

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

src/tests/unit/collectives/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
caf_compile_executable(co_sum_test co_sum.F90)
22
caf_compile_executable(co_broadcast_test co_broadcast.F90)
33
caf_compile_executable(co_broadcast_derived_type_test co_broadcast_derived_type.f90)
4-
caf_compile_executable(co_broadcast_allocatable_components_test co_broadcast_allocatable_components.f90)
4+
if((gfortran_compiler AND (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0.0)) OR (CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}))
5+
caf_compile_executable(co_broadcast_allocatable_components_test co_broadcast_allocatable_components.f90)
6+
endif()
57
caf_compile_executable(co_min_test co_min.F90)
68
caf_compile_executable(co_max_test co_max.F90)
79
caf_compile_executable(co_reduce_test co_reduce.F90)

src/tests/unit/collectives/co_broadcast_derived_type.f90

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,41 @@ function f(x) result(y)
2424
type, extends(parent) :: child
2525

2626
! Scalar and array derived-type components
27-
type(component) a, b(1,2,1, 1,1,1, 1,1,1, 1,1,1, 1,1,1)
27+
type(component) a, b(1,2,1, 1,1,1, 1)
2828

2929
! Scalar and array intrinsic-type components
3030
character(len=len(text)) :: c="", z(0)
3131
complex :: i=(0.,0.), j(1)=(0.,0.)
3232
integer :: k=0, l(2,3)=0
33-
logical :: r=.false., s(1,2,3, 1,2,3, 1,2,3, 1,2,3, 1,2,3)=.false.
33+
logical :: r=.false., s(1,2,3, 1,2,3, 1)=.false.
3434
real :: t=0., u(3,2,1)=0.
3535

3636
! Scalar and array pointer components
3737
character(len=len(text)), pointer :: &
38-
char_ptr=>null(), char_ptr_maxdim(:,:,:, :,:,:, :,:,:, :,:,:, :,:,:)=>null()
39-
complex, pointer :: cplx_ptr=>null(), cplx_ptr_maxdim(:,:,:, :,:,:, :,:,:, :,:,:, :,:,:)=>null()
40-
integer, pointer :: int_ptr =>null(), int_ptr_maxdim (:,:,:, :,:,:, :,:,:, :,:,:, :,:,:)=>null()
41-
logical, pointer :: bool_ptr=>null(), bool_ptr_maxdim(:,:,:, :,:,:, :,:,:, :,:,:, :,:,:)=>null()
42-
real, pointer :: real_ptr=>null(), real_ptr_maxdim(:,:,:, :,:,:, :,:,:, :,:,:, :,:,:)=>null()
38+
char_ptr=>null(), char_ptr_maxdim(:,:,:, :,:,:, :)=>null()
39+
complex, pointer :: cplx_ptr=>null(), cplx_ptr_maxdim(:,:,:, :,:,:, :)=>null()
40+
integer, pointer :: int_ptr =>null(), int_ptr_maxdim (:,:,:, :,:,:, :)=>null()
41+
logical, pointer :: bool_ptr=>null(), bool_ptr_maxdim(:,:,:, :,:,:, :)=>null()
42+
real, pointer :: real_ptr=>null(), real_ptr_maxdim(:,:,:, :,:,:, :)=>null()
4343
procedure(f), pointer :: procedure_pointer=>null()
4444
end type
4545

4646
type(child) message
4747
type(child) :: content = child( & ! define content using the insrinsic structure constructor
4848
parent=parent(heritable=-4), & ! parent
49-
a=component(-3), b=reshape([component(-2),component(-1)], [1,2,1, 1,1,1, 1,1,1, 1,1,1, 1,1,1]), & ! derived types
49+
a=component(-3), b=reshape([component(-2),component(-1)], [1,2,1, 1,1,1, 1]), & ! derived types
5050
c=text, z=[character(len=len(text))::], i=(0.,1.), j=(2.,3.), k=4, l=5, r=.true., s=.true., t=7., u=8. & ! intrinsic types
5151
)
5252

5353
associate(me=>this_image())
5454

5555
if (me==sender) then
5656
message = content
57-
allocate(message%char_ptr, message%char_ptr_maxdim(1,1,2, 1,1,1, 1,1,1, 1,1,1, 1,1,1), source=text )
58-
allocate(message%cplx_ptr, message%cplx_ptr_maxdim(1,1,1, 1,1,2, 1,1,1, 1,1,1, 1,1,1), source=(0.,1.))
59-
allocate(message%int_ptr , message%int_ptr_maxdim (1,1,1, 1,1,1, 1,1,2, 1,1,1, 1,1,1), source=2 )
60-
allocate(message%bool_ptr, message%bool_ptr_maxdim(1,1,1, 1,2,1, 1,1,1, 1,1,2, 1,1,1), source=.true. )
61-
allocate(message%real_ptr, message%real_ptr_maxdim(1,1,1, 1,1,1, 1,1,1, 1,1,1, 1,1,2), source=3. )
57+
allocate(message%char_ptr, message%char_ptr_maxdim(1,1,2, 1,1,1, 1), source=text )
58+
allocate(message%cplx_ptr, message%cplx_ptr_maxdim(1,1,1, 1,1,2, 1), source=(0.,1.))
59+
allocate(message%int_ptr , message%int_ptr_maxdim (1,1,1, 1,1,1, 1), source=2 )
60+
allocate(message%bool_ptr, message%bool_ptr_maxdim(1,1,1, 1,2,1, 1), source=.true. )
61+
allocate(message%real_ptr, message%real_ptr_maxdim(1,1,1, 1,1,1, 1), source=3. )
6262
end if
6363

6464
call co_broadcast(message,source_image=sender)

0 commit comments

Comments
 (0)