diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/global_vars_f90_init.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/global_vars_f90_init.f90 | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/global_vars_f90_init.f90 b/gcc/testsuite/gfortran.dg/global_vars_f90_init.f90 new file mode 100644 index 000000000..aa1a60ba4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/global_vars_f90_init.f90 @@ -0,0 +1,18 @@ +! { 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 + call abort() + endif + end subroutine test_globals +end module global_vars_f90_init + +! { dg-final { cleanup-modules "global_vars_f90_init" } } |