| 1 |
! { dg-do run } |
| 2 |
! { dg-additional-sources only_clause_main.c } |
| 3 |
module testOnlyClause |
| 4 |
|
| 5 |
contains |
| 6 |
subroutine testOnly(cIntPtr) bind(c, name="testOnly") |
| 7 |
use, intrinsic :: iso_c_binding, only: c_ptr, c_int, c_f_pointer |
| 8 |
implicit none |
| 9 |
type(c_ptr), value :: cIntPtr |
| 10 |
integer(c_int), pointer :: f90IntPtr |
| 11 |
|
| 12 |
call c_f_pointer(cIntPtr, f90IntPtr) |
| 13 |
|
| 14 |
! f90IntPtr coming in has value of -11; this will make it -12 |
| 15 |
f90IntPtr = f90IntPtr - 1 |
| 16 |
if(f90IntPtr .ne. -12) then |
| 17 |
STOP 1 |
| 18 |
endif |
| 19 |
end subroutine testOnly |
| 20 |
end module testOnlyClause |