Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / bind_c_procs_3.f90
blobd58289f71249d8103ae40bea5ea5aaf36db50adb
1 ! { dg-do run }
3 ! Test the fix for PR92123, in which 'dat' caused an error with the message
4 ! "Scalar variable 'dat' at ?? with POINTER or ALLOCATABLE in procedure Fsub
5 ! with BIND(C) is not yet supported."
7 ! Contributed by Vipul Parekh <parekhvs@gmail.com>
9 module m
10 use, intrinsic :: iso_c_binding, only : c_int
11 contains
12 subroutine Fsub( dat ) bind(C, name="Fsub")
13 !.. Argument list
14 integer(c_int), allocatable, intent(out) :: dat
15 dat = 42
16 return
17 end subroutine
18 end module m
20 use, intrinsic :: iso_c_binding, only : c_int
21 use m, only : Fsub
22 integer(c_int), allocatable :: x
23 call Fsub( x )
24 if (x .ne. 42) stop 1
25 end