Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 9d657a5

Browse files
committed
linalg-inverse: gcc-15 test fix
1 parent 01464c7 commit 9d657a5

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

‎test/linalg/test_linalg_inverse.fypp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ module test_linalg_inverse
2222
allocate(tests(0))
2323

2424
#:for rk,rt,ri in RC_KINDS_TYPES
25-
tests = [tests,new_unittest("${ri}$_eye_inverse",test_${ri}$_eye_inverse), &
26-
new_unittest("${ri}$_singular_inverse",test_${ri}$_singular_inverse), &
27-
new_unittest("${ri}$_random_spd_inverse",test_${ri}$_random_spd_inverse)]
25+
call add_test(tests,new_unittest("${ri}$_eye_inverse",test_${ri}$_eye_inverse))
26+
call add_test(tests,new_unittest("${ri}$_singular_inverse",test_${ri}$_singular_inverse))
27+
call add_test(tests,new_unittest("${ri}$_random_spd_inverse",test_${ri}$_random_spd_inverse))
2828
#:endfor
2929

3030
end subroutine test_inverse_matrix
@@ -291,6 +291,27 @@ module test_linalg_inverse
291291

292292
#:endfor
293293

294+
! gcc-15 bugfix utility
295+
pure subroutine add_test(tests,new_test)
296+
type(unittest_type), allocatable, intent(inout) :: tests(:)
297+
type(unittest_type), intent(in) :: new_test
298+
299+
integer :: n
300+
type(unittest_type), allocatable :: new_tests(:)
301+
302+
if (allocated(tests)) then
303+
n = size(tests)
304+
else
305+
n = 0
306+
end if
307+
308+
allocate(new_tests(n+1))
309+
if (n>0) new_tests(1:n) = tests(1:n)
310+
new_tests(1+n) = new_test
311+
call move_alloc(from=new_tests,to=tests)
312+
313+
end subroutine add_test
314+
294315
end module test_linalg_inverse
295316

296317
program test_inv

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /