coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / iso_fortran_env_1.f90
blob17e9c7ade360a7e175c6c7587190e4cbeef92a89
1 ! { dg-do run }
2 module iso_fortran_env
3 real :: x
4 end module iso_fortran_env
6 subroutine bar
7 use , intrinsic :: iso_fortran_env
8 implicit none
10 if (file_storage_size /= 8) call abort
11 if (character_storage_size /= 8) call abort
12 if (all (numeric_storage_size /= [ 8, 16, 32, 64, 128])) call abort
13 if (input_unit /= 5) call abort
14 if (output_unit /= 6) call abort
15 if (error_unit /= 0) call abort
16 if (iostat_end /= -1) call abort
17 if (iostat_eor /= -2) call abort
18 end
20 subroutine bar2
21 use , intrinsic :: iso_fortran_env, only : file_storage_size, &
22 character_storage_size, numeric_storage_size, input_unit, output_unit, &
23 error_unit, iostat_end, iostat_eor
24 implicit none
26 if (file_storage_size /= 8) call abort
27 if (character_storage_size /= 8) call abort
28 if (all (numeric_storage_size /= [ 8, 16, 32, 64, 128])) call abort
29 if (input_unit /= 5) call abort
30 if (output_unit /= 6) call abort
31 if (error_unit /= 0) call abort
32 if (iostat_end /= -1) call abort
33 if (iostat_eor /= -2) call abort
34 end
36 program test
37 use , intrinsic :: iso_fortran_env, uu => output_unit
38 implicit none
40 if (input_unit /= 5 .or. uu /= 6) call abort
41 call bar
42 call bar2
43 end