view gcc/testsuite/gfortran.dg/global_vars_f90_init.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do run }
! { dg-additional-sources global_vars_f90_init_driver.c }
module global_vars_f90_init
  use, intrinsic :: iso_c_binding, only: c_int
  implicit none

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

contains
  subroutine test_globals() bind(c)
    ! the value of I is initialized above
    if(I .ne. 2) then
       STOP 1
    endif
  end subroutine test_globals
end module global_vars_f90_init