File: is_iostat_end_eor_2.f90

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (39 lines) | stat: -rw-r--r-- 1,488 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
! Check that we correctly simplify IS_IOSTAT_END and IS_IOSTAT_EOR.
! Not very useful, but required by the standards
!
! This test relies on the error numbers for END and EOR being -1 and -2.
! This is good to actual
!
! { dg-do compile }
!

  use iso_fortran_env, only : iostat_end, iostat_eor
  implicit none

  integer(kind=merge(4, 0, is_iostat_end(-1))) :: a
  integer(kind=merge(4, 0, is_iostat_end(-1_1))) :: b
  integer(kind=merge(4, 0, is_iostat_end(-1_2))) :: c
  integer(kind=merge(4, 0, is_iostat_end(-1_4))) :: d
  integer(kind=merge(4, 0, is_iostat_end(-1_8))) :: e

  integer(kind=merge(4, 0, is_iostat_eor(-2))) :: f
  integer(kind=merge(4, 0, is_iostat_eor(-2_1))) :: g
  integer(kind=merge(4, 0, is_iostat_eor(-2_2))) :: h
  integer(kind=merge(4, 0, is_iostat_eor(-2_4))) :: i
  integer(kind=merge(4, 0, is_iostat_eor(-2_8))) :: j

  integer(kind=merge(0, 4, is_iostat_eor(-1))) :: k
  integer(kind=merge(0, 4, is_iostat_end(-2))) :: l

  integer(kind=merge(0, 4, is_iostat_eor(0))) :: m
  integer(kind=merge(0, 4, is_iostat_end(0))) :: n

  integer(kind=merge(4, 0, is_iostat_end(0))) :: o ! { dg-error "not supported for type" }
  integer(kind=merge(4, 0, is_iostat_eor(0))) :: p ! { dg-error "not supported for type" }

  integer(kind=merge(4, 0, is_iostat_eor(iostat_eor))) :: q
  integer(kind=merge(4, 0, is_iostat_end(iostat_end))) :: r
  integer(kind=merge(0, 4, is_iostat_end(iostat_eor))) :: s
  integer(kind=merge(0, 4, is_iostat_eor(iostat_end))) :: t

  end