Skip to content

Commit 01464c7

Browse files
committed
test_determinant: gcc-15 fix
1 parent 25f94a9 commit 01464c7

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

test/linalg/test_linalg_determinant.fypp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ module test_linalg_determinant
2323

2424
#:for rk,rt in RC_KINDS_TYPES
2525
#:if rk!="xdp"
26-
tests = [tests,new_unittest("$eye_det_${rt[0]}$${rk}$",test_${rt[0]}$${rk}$_eye_determinant)]
27-
tests = [tests,new_unittest("$eye_det_multiple_${rt[0]}$${rk}$",test_${rt[0]}$${rk}$_eye_multiple)]
26+
call add_test(tests,new_unittest("$eye_det_${rt[0]}$${rk}$",test_${rt[0]}$${rk}$_eye_determinant))
27+
call add_test(tests,new_unittest("$eye_det_multiple_${rt[0]}$${rk}$",test_${rt[0]}$${rk}$_eye_multiple))
2828
#:endif
2929
#:endfor
3030
#:for ck,ct in CMPLX_KINDS_TYPES
3131
#:if ck!="xdp"
32-
tests = [tests,new_unittest("$complex_det_${rt[0]}$${rk}$",test_${ct[0]}$${ck}$_complex_determinant)]
32+
call add_test(tests,new_unittest("$complex_det_${rt[0]}$${rk}$",test_${ct[0]}$${ck}$_complex_determinant))
3333
#:endif
3434
#: endfor
3535

@@ -143,6 +143,27 @@ module test_linalg_determinant
143143

144144
#:endif
145145
#:endfor
146+
147+
! gcc-15 bugfix utility
148+
pure subroutine add_test(tests,new_test)
149+
type(unittest_type), allocatable, intent(inout) :: tests(:)
150+
type(unittest_type), intent(in) :: new_test
151+
152+
integer :: n
153+
type(unittest_type), allocatable :: new_tests(:)
154+
155+
if (allocated(tests)) then
156+
n = size(tests)
157+
else
158+
n = 0
159+
end if
160+
161+
allocate(new_tests(n+1))
162+
if (n>0) new_tests(1:n) = tests(1:n)
163+
new_tests(1+n) = new_test
164+
call move_alloc(from=new_tests,to=tests)
165+
166+
end subroutine add_test
146167

147168
end module test_linalg_determinant
148169

0 commit comments

Comments
 (0)