Skip to content

Commit

Permalink
Add test for exp (**) in arg list
Browse files Browse the repository at this point in the history
  • Loading branch information
rjfarmer committed Jan 18, 2024
1 parent f529cab commit e307d58
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/explicit_arrays.f90
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,14 @@ function func_return_2d_int_arr() result(x)

end function func_return_2d_int_arr


subroutine func_exp_array_in(n,x)
integer, intent(in) :: n
integer, dimension(2*n,2**n) :: x

x = 5

end subroutine func_exp_array_in


end module explicit_arrays
10 changes: 10 additions & 0 deletions tests/explicit_arrays_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,13 @@ def test_func_return_2d_int_arr(self):
assert np.array_equal(
res.result, np.array([1, 2, 3, 4, 5, 6]).reshape(3, 2, order="F")
)

def test_func_exp_array_in(self):
n = 3
y = np.zeros((2 * n, 2**n), dtype=int)

res = x.func_exp_array_in(n, y)

result = np.zeros(np.shape(y), dtype=int)
result[:, :] = 5
assert np.array_equal(res.args["x"], result)

0 comments on commit e307d58

Please sign in to comment.