summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorRohit Goswami <rog32@hi.is>2022-06-21 18:45:55 +0300
committerRohit Goswami <rog32@hi.is>2022-06-21 18:49:17 +0300
commit278309170715384a542b7e82b83d57f73025122e (patch)
treed99823ea2a173f359549af4a5edf06c6c39ce418 /numpy
parentf6f0ad0643848faa39d62a6a44bbe72aa6f0ad3b (diff)
downloadnumpy-278309170715384a542b7e82b83d57f73025122e.tar.gz
TST: Ensure the f2py value attribute is handled
Diffstat (limited to 'numpy')
-rw-r--r--numpy/f2py/tests/src/value_attrspec/gh21665.f909
-rw-r--r--numpy/f2py/tests/test_value_attrspec.py14
2 files changed, 23 insertions, 0 deletions
diff --git a/numpy/f2py/tests/src/value_attrspec/gh21665.f90 b/numpy/f2py/tests/src/value_attrspec/gh21665.f90
new file mode 100644
index 000000000..7d9dc0fd4
--- /dev/null
+++ b/numpy/f2py/tests/src/value_attrspec/gh21665.f90
@@ -0,0 +1,9 @@
+module fortfuncs
+ implicit none
+contains
+ subroutine square(x,y)
+ integer, intent(in), value :: x
+ integer, intent(out) :: y
+ y = x*x
+ end subroutine square
+end module fortfuncs
diff --git a/numpy/f2py/tests/test_value_attrspec.py b/numpy/f2py/tests/test_value_attrspec.py
new file mode 100644
index 000000000..83aaf6c91
--- /dev/null
+++ b/numpy/f2py/tests/test_value_attrspec.py
@@ -0,0 +1,14 @@
+import os
+import pytest
+
+from . import util
+
+class TestValueAttr(util.F2PyTest):
+ sources = [util.getpath("tests", "src", "value_attrspec", "gh21665.f90")]
+
+ # gh-21665
+ def test_long_long_map(self):
+ inp = 2
+ out = self.module.fortfuncs.square(inp)
+ exp_out = 4
+ assert out == exp_out