Skip to content

Commit 05ab421

Browse files
committed
build(stop_and_print): HAVE_STOP_AND_PRINT_SUPPORT
This commit defined and uses a new macro to remove the new stop_and_print feature and corresponding tests with compilers or compiler versions that do do not compile the code correctly.
1 parent d6159f0 commit 05ab421

5 files changed

Lines changed: 22 additions & 11 deletions

File tree

include/language-support.F90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
#define GCC_GE_MINIMUM
1515
#endif
1616

17+
#if defined(__GFORTRAN__) || __flang_major__ >= 20 || __INTEL_COMPILER >= 20260000
18+
# define HAVE_STOP_AND_PRINT_SUPPORT 1
19+
#else
20+
# define HAVE_STOP_AND_PRINT_SUPPORT 0
21+
#endif
22+
1723
! If not already determined, make a compiler-dependent determination of whether Julienne may use
1824
! multi-image features such as `this_image()` and `sync all`.
1925
#ifndef HAVE_MULTI_IMAGE_SUPPORT

src/julienne/julienne_stop_and_print_m.F90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
! Copyright (c), The Regents of the University of California and Sourcery Institute
22
! Terms of use are as specified in LICENSE.txt
33

4+
#include "language-support.F90"
5+
6+
#if HAVE_STOP_AND_PRINT_SUPPORT
7+
48
module julienne_stop_and_print_m
59
!! Define a pure subroutine that formats and prints various data types during error termination
610
use julienne_string_m, only : string_t
@@ -64,3 +68,4 @@ pure module function character_stop_code(stuff) result(stop_code)
6468
end interface
6569

6670
end module julienne_stop_and_print_m
71+
#endif

src/julienne/julienne_stop_and_print_s.F90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
! Copyright (c), The Regents of the University of California and Sourcery Institute
22
! Terms of use are as specified in LICENSE.txt
33

4+
#include "language-support.F90"
5+
6+
#if HAVE_STOP_AND_PRINT_SUPPORT
7+
48
submodule(julienne_stop_and_print_m) julienne_stop_and_print_s
59
use julienne_string_m, only : operator(.csv.), operator(.separatedBy.)
610
use julienne_file_m, only : file_t
@@ -173,3 +177,5 @@ pure subroutine stop_and_print_header_data_footer(data, header, footer)
173177
end procedure
174178

175179
end submodule julienne_stop_and_print_s
180+
181+
#endif

test/driver.F90

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ program test_suite_driver
2727
associate(test_harness => test_harness_t([ &
2828
test_fixture_t( assert_test_t()) &
2929
,test_fixture_t( bin_test_t()) &
30-
#if (__FLANG_MAJOR__ > 0) && (__FLANG_MAJOR__ < 20)
31-
#else
30+
#if HAVE_STOP_AND_PRINT_SUPPORT
3231
,test_fixture_t( character_stop_code_test_t()) &
3332
#endif
3433
,test_fixture_t( formats_test_t()) &

test/modules/character_stop_code_test_m.F90

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "language-support.F90"
55

6+
#if HAVE_STOP_AND_PRINT_SUPPORT
7+
68
module character_stop_code_test_m
79
!! Check data partitioning across bins
810
use julienne_m, only : &
@@ -67,15 +69,6 @@ function results() result(test_results)
6769
,test_description_t(string_t("converting a 1D string_t array into a CSV character stop code") ) &
6870
,test_description_t(string_t("converting a file_t object into a new-line-separated character stop code")) &
6971
,test_description_t(string_t("converting a writable_t child object into character stop code") ) &
70-
#elif __FLANG_MAJOR__ > 19
71-
! Skip all tests
72-
test_description_t(string_t("converting scalars to character stop codes") ) &
73-
,test_description_t(string_t("converting 1D arrays to comma-separated-value (CSV) character stop codes")) &
74-
,test_description_t(string_t("converting 2D arrays to new-line-separated CSV character stop codes") ) &
75-
,test_description_t(string_t("converting 3D arrays to new-line-separated CSV character stop codes") ) &
76-
,test_description_t(string_t("converting a 1D string_t array into a CSV character stop code") ) &
77-
,test_description_t(string_t("converting a file_t object into a new-line-separated character stop code")) &
78-
,test_description_t(string_t("converting a writable_t child object into character stop code") ) &
7972
#else
8073
! Run all tests
8174
test_description_t(string_t("converting scalars to character stop codes") , usher(check_intrinsic_scalars)) &
@@ -565,3 +558,5 @@ subroutine write_formatted(self, unit, edit_descriptor, v_list, iostat, iomsg)
565558
end subroutine
566559

567560
end module character_stop_code_test_m
561+
562+
#endif

0 commit comments

Comments
 (0)