Skip to content

Commit e2008a0

Browse files
committed
fix(compiler_test): revert to standard conformance
This commit effectively reverts commit eca3e6b, which relied on labeling a impure external procedure as pure via an interface.
1 parent 937e067 commit e2008a0

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

test/compiler_test.f90

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ module compiler_test
22
!! Test compiler conformance with each scenario in which the Fortran 2018
33
!! standard mandates type finalization.
44
use veggies, only: result_t, test_item_t, describe, it, assert_equals, assert_that
5+
use iso_fortran_env, only : compiler_version
56
implicit none
67

78
private
@@ -201,17 +202,34 @@ function check_specification_expression() result(result_)
201202
type(result_t) result_
202203
integer exit_status
203204
logical error_termination_occurred
204-
205+
205206
call execute_command_line( &
206-
command = "fpm run --example specification_expression_finalization > /dev/null 2>&1", &
207+
command = "fpm run --example specification_expression_finalization "// fpm_compiler_arguments() //" > /dev/null 2>&1", &
207208
wait = .true., &
208209
exitstat = exit_status &
209210
)
210211
error_termination_occurred = exit_status /=0
211212
result_ = assert_that(error_termination_occurred)
212213

214+
contains
215+
216+
pure function fpm_compiler_arguments() result(args)
217+
character(len=:), allocatable :: args
218+
219+
associate(compiler_identity=>compiler_version())
220+
if (scan(compiler_identity, "GCC ")==1) then
221+
args = " "
222+
else if (scan(compiler_identity, "NAG Fortran ")==1) then
223+
args = "--compiler nagfor --flag -fpp"
224+
else
225+
error stop "----> Unrecognized compiler_version() in function fpm_compiler_arguments. <----"
226+
end if
227+
end associate
228+
end function
229+
213230
end function
214231

232+
215233
function check_intent_out_finalization() result(result_)
216234
!! Test conformance with Fortran 2018 standard clause 7.5.6.3, paragraph 7:
217235
!! "nonpointer, nonallocatable, INTENT (OUT) dummy argument"

0 commit comments

Comments
 (0)