Skip to content

Commit d01de24

Browse files
committed
Add reg test for issue #322. N.B.! Not yet enabled
- Enable this once we figure out which GCCs it's fixed on.
1 parent 2d85c98 commit d01de24

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,11 @@ if(opencoarrays_aware_compiler)
748748
add_caf_test(source-alloc-no-sync 8 source-alloc-sync)
749749
endif()
750750

751+
# Fixed on GCC 6 > 6.4, 7 > 7.3 and 8.x
752+
if (FALSE) # FIXME!
753+
add_caf_test(non-coarray-vector-indexed-lhs issue-322-non-coarray-vector-idx-lhs)
754+
endif()
755+
751756
# Open GCC 7 regressions
752757
if ((CAF_RUN_DEVELOPER_TESTS OR $ENV{OPENCOARRAYS_DEVELOPER}) OR
753758
(gfortran_compiler AND (

src/tests/regression/reported/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ caf_compile_executable(issue-488-multi-dim-cobounds issue-488-multi-dim-cobounds
99
caf_compile_executable(issue-493-coindex-slice issue-493-coindex-slice.f90)
1010
caf_compile_executable(issue-503-multidim-array-broadcast issue-503-multidim-array-broadcast.f90)
1111
caf_compile_executable(issue-503-non-contig-red-ndarray issue-503-non-contig-red-ndarray.f90)
12+
caf_compile_executable(issue-322-non-coarray-vector-idx-lhs issue-322-non-coarray-vector-idx-lhs.f90)
1213
if (gfortran_compiler AND (NOT CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 7.0.0))
1314
caf_compile_executable(issue-515-mimic-mpi-gatherv issue-515-mimic-mpi-gatherv.f90)
1415
endif()
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
program mod_vecsub_01
2+
!! Issue #322 reported by @reinh-bader
3+
!! https://github.com/sourceryinstitute/OpenCoarrays/issues/322
4+
!! Related to other vector indexing issues
5+
implicit none
6+
integer, parameter :: ndim = 5, vdim = 2
7+
real :: vec(ndim), res(ndim)[*]
8+
integer :: idx(vdim)
9+
integer :: i, me
10+
logical :: ok[*]
11+
12+
res = [ (real(i), i=1, ndim) ]
13+
vec = 0.0
14+
idx = [ ndim, 1 ]
15+
ok = .true.
16+
sync all
17+
me = this_image()
18+
vec(idx) = res(1:2)[1]
19+
if (vec(1) /= 2.0 .or. vec(5) /= 1.0) then
20+
critical
21+
ok[1] = .false.
22+
write(*, *) 'FAIL on image ',me,vec(idx)
23+
end critical
24+
end if
25+
if (me == 1) then
26+
if (ok) then
27+
write(*, *) 'Test passed.'
28+
else
29+
error stop 1
30+
end if
31+
end if
32+
end program

0 commit comments

Comments
 (0)