gcc/fortran/
[official-gcc.git] / gcc / testsuite / gfortran.dg / getenv_1.f90
blobfb0a809e64341671844acb3382722924fed31044
1 ! { dg-do run }
2 ! Test the getenv and get_environment_variable intrinsics.
3 ! Ignore the return value because it's not supported/meaningful on all targets
4 program getenv_1
5 implicit none
6 character(len=101) :: var
7 character(len=*), parameter :: home = 'HOME'
8 integer :: len, stat
9 call getenv(name=home, value=var)
10 call get_environment_variable(name=home, value=var, &
11 length=len, status=stat)
12 end program getenv_1