8000 TST: Add a another test for gh-25207 · numpy/numpy@809bd0f · GitHub
[go: up one dir, main page]

Skip to content

Commit 809bd0f

Browse files
committed
TST: Add a another test for gh-25207
1 parent 4d5521f commit 809bd0f

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

numpy/f2py/tests/src/isocintrin/isoCtests.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,15 @@ subroutine c_add_int64(a, b, c) bind(c)
2020
integer(c_int64_t), intent(out) :: c
2121
c = a + b
2222
end subroutine c_add_int64
23+
! gh-25207
24+
subroutine add_arr(A, B, C)
25+
integer(c_int64_t), intent(in) :: A(3)
26+
integer(c_int64_t), intent(in) :: B(3)
27+
integer(c_int64_t), intent(out) :: C(3)
28+
integer :: j
29+
30+
do j = 1, 3
31+
C(j) = A(j)+B(j)
32+
end do
33+
end subroutine
2334
end module coddity

numpy/f2py/tests/test_isoc.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from . import util
22
import numpy as np
3+
from numpy.testing import assert_allclose
34

45
class TestISOC(util.F2PyTest):
56
sources = [
@@ -24,6 +25,14 @@ def test_bindc_kinds(self):
2425
exp_out = 21
2526
assert out == exp_out
2627

28+
# gh-25207
29+
def test_bindc_add_arr(self):
30+
a = np.array([1,2,3])
31+
b = np.array([1,2,3])
32+
out = self.module.coddity.add_arr(a, b)
33+
exp_out = a*2
34+
assert_allclose(out, exp_out)
35+
2736

2837
def test_process_f2cmap_dict():
2938
from numpy.f2py.auxfuncs import process_f2cmap_dict

0 commit comments

Comments
 (0)
0