2017-02-20 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / is_iostat_end_eor_2.f90
blobeda9d31df1965de27d41bbdb449d32c9a91b2712
1 ! Check that we correctly simplify IS_IOSTAT_END and IS_IOSTAT_EOR.
2 ! Not very useful, but required by the standards
4 ! This test relies on the error numbers for END and EOR being -1 and -2.
5 ! This is good to actual
7 ! { dg-do compile }
10 use iso_fortran_env, only : iostat_end, iostat_eor
11 implicit none
13 integer(kind=merge(4, 0, is_iostat_end(-1))) :: a
14 integer(kind=merge(4, 0, is_iostat_end(-1_1))) :: b
15 integer(kind=merge(4, 0, is_iostat_end(-1_2))) :: c
16 integer(kind=merge(4, 0, is_iostat_end(-1_4))) :: d
17 integer(kind=merge(4, 0, is_iostat_end(-1_8))) :: e
19 integer(kind=merge(4, 0, is_iostat_eor(-2))) :: f
20 integer(kind=merge(4, 0, is_iostat_eor(-2_1))) :: g
21 integer(kind=merge(4, 0, is_iostat_eor(-2_2))) :: h
22 integer(kind=merge(4, 0, is_iostat_eor(-2_4))) :: i
23 integer(kind=merge(4, 0, is_iostat_eor(-2_8))) :: j
25 integer(kind=merge(0, 4, is_iostat_eor(-1))) :: k
26 integer(kind=merge(0, 4, is_iostat_end(-2))) :: l
28 integer(kind=merge(0, 4, is_iostat_eor(0))) :: m
29 integer(kind=merge(0, 4, is_iostat_end(0))) :: n
31 integer(kind=merge(4, 0, is_iostat_end(0))) :: o ! { dg-error "not supported for type" }
32 integer(kind=merge(4, 0, is_iostat_eor(0))) :: p ! { dg-error "not supported for type" }
34 integer(kind=merge(4, 0, is_iostat_eor(iostat_eor))) :: q
35 integer(kind=merge(4, 0, is_iostat_end(iostat_end))) :: r
36 integer(kind=merge(0, 4, is_iostat_end(iostat_eor))) :: s
37 integer(kind=merge(0, 4, is_iostat_eor(iostat_end))) :: t
39 end