aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/global_vars_c_init.f90
blob: 60408083951ccb8630c92702be1a30a6f94a15dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
! { dg-do run }
! { dg-additional-sources global_vars_c_init_driver.c }
module global_vars_c_init
  use, intrinsic :: iso_c_binding, only: c_int
  implicit none

  integer(c_int), bind(c, name='i') :: I

contains
  subroutine test_globals() bind(c)
    ! the value of I is initialized above
    if(I .ne. 2) then
       call abort()
    endif
  end subroutine test_globals
end module global_vars_c_init