Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 842e39f

Browse files
committed
TST: Add a another test for gh-25207
1 parent 1e213c0 commit 842e39f

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,6 +1,7 @@
11
from . import util
22
import numpy as np
33
import pytest
4+
from numpy.testing import assert_allclose
45

56
class TestISOC(util.F2PyTest):
67
sources = [
@@ -26,6 +27,14 @@ def test_bindc_kinds(self):
2627
exp_out = 21
2728
assert out == exp_out
2829

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

3039
def test_process_f2cmap_dict():
3140
from numpy.f2py.auxfuncs import process_f2cmap_dict

0 commit comments

Comments
 (0)