isoCtests.f90 998 B

12345678910111213141516171819202122232425262728293031323334
  1. module coddity
  2. use iso_c_binding, only: c_double, c_int, c_int64_t
  3. implicit none
  4. contains
  5. subroutine c_add(a, b, c) bind(c, name="c_add")
  6. real(c_double), intent(in) :: a, b
  7. real(c_double), intent(out) :: c
  8. c = a + b
  9. end subroutine c_add
  10. ! gh-9693
  11. function wat(x, y) result(z) bind(c)
  12. integer(c_int), intent(in) :: x, y
  13. integer(c_int) :: z
  14. z = x + 7
  15. end function wat
  16. ! gh-25207
  17. subroutine c_add_int64(a, b, c) bind(c)
  18. integer(c_int64_t), intent(in) :: a, b
  19. integer(c_int64_t), intent(out) :: c
  20. c = a + b
  21. end subroutine c_add_int64
  22. ! gh-25207
  23. subroutine add_arr(A, B, C)
  24. integer(c_int64_t), intent(in) :: A(3)
  25. integer(c_int64_t), intent(in) :: B(3)
  26. integer(c_int64_t), intent(out) :: C(3)
  27. integer :: j
  28. do j = 1, 3
  29. C(j) = A(j)+B(j)
  30. end do
  31. end subroutine
  32. end module coddity