Skip to content

Commit a92ba10

Browse files
committed
Add testcase for static array access.
1 parent e90b091 commit a92ba10

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,6 +795,7 @@ if(opencoarrays_aware_compiler)
795795
add_caf_test(get_with_offset_1d 2 get_with_offset_1d)
796796
add_caf_test(whole_get_array 2 whole_get_array)
797797
add_caf_test(strided_get 2 strided_get)
798+
add_caf_test(get_static_array 2 get_static_array)
798799

799800
# Pure send tests
800801
add_caf_test(send_array 2 send_array)

src/tests/unit/send-get/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ caf_compile_executable(strided_get strided_get.f90)
1313
caf_compile_executable(get_with_vector_index get_with_vector_index.f90)
1414
## Inquiry functions (these are gets that could be optimized in the future to communicate only the descriptors)
1515
caf_compile_executable(alloc_comp_multidim_shape alloc_comp_multidim_shape.F90)
16+
caf_compile_executable(get_static_array get_static_array.f90)
1617

1718
## Pure send() tests
1819
caf_compile_executable(send_array send_array_test.f90)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
program get_static_array
2+
type :: container
3+
integer, allocatable :: stuff(:)
4+
end type
5+
6+
type(container) :: co_containers(10)[*]
7+
8+
if (this_image() == 1) then
9+
allocate(co_containers(2)%stuff(4))
10+
co_containers(2)%stuff = [1,2,3,4]
11+
end if
12+
13+
sync all
14+
15+
if (this_image() == 2) then
16+
if (any(co_containers(2)[1]%stuff /= [1,2,3,4])) then
17+
error stop "Test failed."
18+
else
19+
print *, "Test passed."
20+
end if
21+
end if
22+
end program
23+

0 commit comments

Comments
 (0)