aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/achar_5.f90
blob: 498c6e3e057bc4d091141ad2d5a655aa6bc2f23c (plain)
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
40
! { dg-do compile }
!
program test

  print *, char(255)
  print *, achar(255)
  print *, char(255,kind=1)
  print *, achar(255,kind=1)
  print *, char(255,kind=4)
  print *, achar(255,kind=4)

  print *, char(0)
  print *, achar(0)
  print *, char(0,kind=1)
  print *, achar(0,kind=1)
  print *, char(0,kind=4)
  print *, achar(0,kind=4)

  print *, char(297) ! { dg-error "too large for the collating sequence" }
  print *, achar(297) ! { dg-error "too large for the collating sequence" }
  print *, char(297,kind=1) ! { dg-error "too large for the collating sequence" }
  print *, achar(297,kind=1) ! { dg-error "too large for the collating sequence" }
  print *, char(297,kind=4)
  print *, achar(297,kind=4)

  print *, char(-1) ! { dg-error "negative" }
  print *, achar(-1) ! { dg-error "negative" }
  print *, char(-1,kind=1) ! { dg-error "negative" }
  print *, achar(-1,kind=1) ! { dg-error "negative" }
  print *, char(-1,kind=4) ! { dg-error "negative" }
  print *, achar(-1,kind=4) ! { dg-error "negative" }

  print *, char(huge(0_8)) ! { dg-error "too large for the collating sequence" }
  print *, achar(huge(0_8)) ! { dg-error "too large for the collating sequence" }
  print *, char(huge(0_8),kind=1) ! { dg-error "too large for the collating sequence" }
  print *, achar(huge(0_8),kind=1) ! { dg-error "too large for the collating sequence" }
  print *, char(huge(0_8),kind=4) ! { dg-error "too large for the collating sequence" }
  print *, achar(huge(0_8),kind=4) ! { dg-error "too large for the collating sequence" }

end program test