annotate gcc/testsuite/gfortran.dg/c_loc_test.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! { dg-additional-sources c_loc_driver.c }
kono
parents:
diff changeset
3 module c_loc_test
kono
parents:
diff changeset
4 implicit none
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 contains
kono
parents:
diff changeset
7 subroutine test0() bind(c)
kono
parents:
diff changeset
8 use, intrinsic :: iso_c_binding
kono
parents:
diff changeset
9 implicit none
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
10 integer(c_int), target :: x
111
kono
parents:
diff changeset
11 type(c_ptr) :: my_c_ptr
kono
parents:
diff changeset
12 interface
kono
parents:
diff changeset
13 subroutine test_address(x, expected_value) bind(c)
kono
parents:
diff changeset
14 use, intrinsic :: iso_c_binding
kono
parents:
diff changeset
15 type(c_ptr), value :: x
kono
parents:
diff changeset
16 integer(c_int), value :: expected_value
kono
parents:
diff changeset
17 end subroutine test_address
kono
parents:
diff changeset
18 end interface
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
19 x = 100_c_int
111
kono
parents:
diff changeset
20 my_c_ptr = c_loc(x)
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21 call test_address(my_c_ptr, 100_c_int)
111
kono
parents:
diff changeset
22 end subroutine test0
kono
parents:
diff changeset
23 end module c_loc_test