aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/unsigned_10.f90
blob: df9167649fe49908c968a1a47b282c5be7c73b23 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
! { dg-do run }
! { dg-options "-funsigned" }
! Test I/O with Z, O and B descriptors.

program main
  implicit none
  unsigned(kind=8) :: u,v
  integer :: i
  open(10,status="scratch")
  u = 3u
  do i=0,63
     write (10,'(Z16)') u
     u = u + u
  end do
  rewind 10
  u = 3u
  do i=0,63
     read (10,'(Z16)') v
     if (u /= v) then
        print *,u,v
     end if
     u = u + u
  end do
  rewind 10
  u = 3u
  do i=0,63
     write (10,'(O22)') u
     u = u + u
  end do
  rewind 10
  u = 3u
  do i=0,63
     read (10,'(O22)') v
     if (u /= v) then
        print *,u,v
     end if
     u = u + u
  end do

  rewind 10
  u = 3u
  do i=0,63
     write (10,'(B64)') u
     u = u + u
  end do
  rewind 10
  u = 3u
  do i=0,63
     read (10,'(B64)') v
     if (u /= v) then
        print *,u,v
     end if
     u = u + u
  end do

end program main