From f96b8daea959db191ff84b80dbc1ea948722fbaa Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Sun, 16 Apr 2023 18:18:02 +0000 Subject: TST: Add a test for gh-23598 --- numpy/f2py/tests/src/crackfortran/gh23598.f90 | 4 ++++ numpy/f2py/tests/test_crackfortran.py | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 numpy/f2py/tests/src/crackfortran/gh23598.f90 (limited to 'numpy') diff --git a/numpy/f2py/tests/src/crackfortran/gh23598.f90 b/numpy/f2py/tests/src/crackfortran/gh23598.f90 new file mode 100644 index 000000000..e0dffb5ef --- /dev/null +++ b/numpy/f2py/tests/src/crackfortran/gh23598.f90 @@ -0,0 +1,4 @@ +integer function intproduct(a, b) result(res) + integer, intent(in) :: a, b + res = a*b +end function diff --git a/numpy/f2py/tests/test_crackfortran.py b/numpy/f2py/tests/test_crackfortran.py index 23965087d..886fc596e 100644 --- a/numpy/f2py/tests/test_crackfortran.py +++ b/numpy/f2py/tests/test_crackfortran.py @@ -322,4 +322,12 @@ class TestNameArgsPatternBacktracking: # we accept that maybe the median might double once, due to # the CPU scheduler acting weird or whatever. More than that # seems suspicious. - assert times_median_doubled < 2 \ No newline at end of file + assert times_median_doubled < 2 + + +class TestFunctionReturn(util.F2PyTest): + sources = [util.getpath("tests", "src", "crackfortran", "gh23598.f90")] + + def test_function_rettype(self): + # gh-23598 + assert self.module.intproduct(3, 4) == 12 -- cgit v1.2.1