diff options
| author | Rohit Goswami <rog32@hi.is> | 2023-04-16 18:18:02 +0000 |
|---|---|---|
| committer | Rohit Goswami <rog32@hi.is> | 2023-04-16 18:18:02 +0000 |
| commit | f96b8daea959db191ff84b80dbc1ea948722fbaa (patch) | |
| tree | 464a189319555138d79cd9a020a996eb46659af6 /numpy | |
| parent | f5ff446c49e21411bac2320cd1d962debd9d1abf (diff) | |
| download | numpy-f96b8daea959db191ff84b80dbc1ea948722fbaa.tar.gz | |
TST: Add a test for gh-23598
Diffstat (limited to 'numpy')
| -rw-r--r-- | numpy/f2py/tests/src/crackfortran/gh23598.f90 | 4 | ||||
| -rw-r--r-- | numpy/f2py/tests/test_crackfortran.py | 10 |
2 files changed, 13 insertions, 1 deletions
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 |
