summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/new_line.f90
blob: aacabc69f6e16507f2ff9aaafc5418631b1fb1a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
! { dg-do run }
! Checks Fortran 2003's new_line intrinsic function
! PR fortran/28585
program new_line_check
  implicit none
  character(len=10) :: a1
  character(len=10) :: a2(2)
  character(len=10), parameter :: a3 = "1234567890"
  character(len=10), parameter :: a4(2) = "1234567890"
  character(len=10), parameter :: a5(2) = repeat("1234567890",2)

  if(achar(10) /= new_line('a')) call abort

  if (iachar(new_line(a1)) /= 10) call abort
  if (iachar(new_line(a2)) /= 10) call abort
  if (iachar(new_line(a3)) /= 10) call abort
  if (iachar(new_line(a4)) /= 10) call abort
  if (iachar(new_line(a5)) /= 10) call abort

end program new_line_check