fix pr/45972
[official-gcc.git] / gcc / testsuite / gfortran.dg / negative-z-descriptor.f90
blob1ad3a32b3a3a424f271cb03c5bae6b73c3f545dd
1 ! { dg-do run }
2 ! PR 22217: Z edit descriptor with negative numbers used to give lots of *
4 program main
5 character(len=70) line
6 character(len=20) fmt
7 write(unit=line,fmt='(Z4)') -1_1
8 if (line(1:4) .ne. ' FF') call abort
9 write(unit=line,fmt='(Z5)') -1_2
10 if (line(1:5) .ne. ' FFFF') call abort
11 write(unit=line,fmt='(Z9)') -1_4
12 if (line(1:9) .ne. ' FFFFFFFF') call abort
13 write(unit=line,fmt='(Z17)') -2_8
14 if (line(1:17) .ne. ' FFFFFFFFFFFFFFFE') call abort
15 write(unit=line,fmt='(Z2)') 10_8
16 if (line(1:2) .ne. ' A') call abort
18 write(unit=line,fmt='(Z8)') -43_8
19 if (line(1:1) .ne. '*') call abort
21 write(unit=line,fmt='(B65)') -1_8
22 if (line(1:2) .ne. ' 1') call abort
23 if (line(64:66) .ne. '11 ') call abort
25 write(unit=line,fmt='(O4)') -2_1
26 if (line(1:4) .ne. ' 376') call abort
27 end