Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ jobs:
fi
if [ "${NATIVE_MULTI_IMAGE}" == true ] ; then
if [[ $COMPILER_VERSION == latest ]] ; then
echo "FFLAGS=$FFLAGS -fcoarray -DHAVE_COARRAY -DHAVE_ALLOC_COARRAY=0 -DHAVE_SAVE_COARRAY=0 -DHAVE_MODULE_COARRAY=0 -DIGNORE_FAILURES=6" >> "$GITHUB_ENV"
echo "FFLAGS=$FFLAGS -fcoarray -DHAVE_COARRAY -DHAVE_ALLOC_COARRAY=0 -DHAVE_SAVE_COARRAY=0 -DHAVE_MODULE_COARRAY=0 -DHAVE_COARRAY_INIT=0 -DIGNORE_FAILURES=6" >> "$GITHUB_ENV"
else
echo "FFLAGS=$FFLAGS -fcoarray -DIGNORE_FAILURES=8" >> "$GITHUB_ENV"
fi
Expand Down
44 changes: 35 additions & 9 deletions app/native-multi-image.F90
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@
#ifndef HAVE_MODULE_COARRAY
#define HAVE_MODULE_COARRAY HAVE_COARRAY
#endif
#ifndef HAVE_COARRAY_INIT
#define HAVE_COARRAY_INIT HAVE_COARRAY
#endif

! coarray query intrinsics
#ifndef HAVE_COARRAY_QUERY
Expand Down Expand Up @@ -108,6 +111,13 @@
end if ; \
END BLOCK

#define COARRAY_INT_INIT_VALUE 123456789
#if HAVE_COARRAY_INIT
# define COARRAY_INT_INIT = COARRAY_INT_INIT_VALUE
#else
# define COARRAY_INT_INIT
#endif

module helpers
USE, INTRINSIC :: ISO_FORTRAN_ENV
USE, INTRINSIC :: ISO_C_BINDING, only: c_int8_t
Expand Down Expand Up @@ -155,13 +165,18 @@ subroutine test_save_extern_coarray()
use helpers
implicit none
logical, save :: once = .true.
integer, save :: esc_int_1[*]
integer, save :: esc_int_2[2,*]
integer, save :: esc_int_3[2:3,4:5,*]
integer, save :: esc_int_1[*] COARRAY_INT_INIT
integer, save :: esc_int_2[2,*] COARRAY_INT_INIT
integer, save :: esc_int_3[2:3,4:5,*] COARRAY_INT_INIT

if (once) then
once = .false.
call status("Testing external SAVE coarrays...")
# if HAVE_COARRAY_INIT
CHECK_VALI(esc_int_1, COARRAY_INT_INIT_VALUE)
CHECK_VALI(esc_int_2, COARRAY_INT_INIT_VALUE)
CHECK_VALI(esc_int_3, COARRAY_INT_INIT_VALUE)
# endif
esc_int_1 = 1
esc_int_2 = 2
esc_int_3 = 3
Expand All @@ -178,9 +193,9 @@ module coarrays
implicit none

# if HAVE_MODULE_COARRAY
integer :: msc_int_1[*]
integer :: msc_int_2[2,*]
integer :: msc_int_3[2:3,4:5,*]
integer :: msc_int_1[*] ! COARRAY_INT_INIT
integer :: msc_int_2[2,*] ! COARRAY_INT_INIT
integer :: msc_int_3[2:3,4:5,*] ! COARRAY_INT_INIT
# endif

public
Expand All @@ -194,6 +209,11 @@ subroutine test_module_coarray()
if (once) then
once = .false.
call status("Testing module SAVE coarrays...")
# if HAVE_COARRAY_INIT && 0 /* disabled pending LFortran issue #12163 */
CHECK_VALI(msc_int_1, COARRAY_INT_INIT_VALUE)
CHECK_VALI(msc_int_2, COARRAY_INT_INIT_VALUE)
CHECK_VALI(msc_int_3, COARRAY_INT_INIT_VALUE)
# endif
msc_int_1 = 1
msc_int_2 = 2
msc_int_3 = 3
Expand Down Expand Up @@ -227,9 +247,9 @@ program native_multi_image
type(TEAM_TYPE) :: default_team
# endif
# if HAVE_MAIN_COARRAY
integer :: sca_int_1[*]
integer :: sca_int_2[2,*]
integer :: sca_int_3[2,3,*]
integer :: sca_int_1[*] COARRAY_INT_INIT
integer :: sca_int_2[2,*] COARRAY_INT_INIT
integer :: sca_int_3[2,3,*] COARRAY_INT_INIT
# endif
# if HAVE_EVENT_TYPE
type(event_type), target :: default_event[*]
Expand Down Expand Up @@ -338,6 +358,12 @@ program native_multi_image
# endif

# if HAVE_MAIN_COARRAY
# if HAVE_COARRAY_INIT
call status("Testing main program coarray initialization...")
CHECK_VALI(sca_int_1, COARRAY_INT_INIT_VALUE)
CHECK_VALI(sca_int_2, COARRAY_INT_INIT_VALUE)
CHECK_VALI(sca_int_3, COARRAY_INT_INIT_VALUE)
# endif
# if HAVE_COBOUND
call status("Testing LCOBOUND/UCOBOUND...")
if (THIS_IMAGE() == 1) then
Expand Down