Debian Codegraph @

gcc/testsuite/gfortran.dg/pr117819.f90

raw
1 ! { dg-do run }
2 ! PR117819
3 Program xe1
4 Implicit None
5 Character(6) string
6 Integer x
7 Logical :: ok = .True.
8 string = '111111'
9 !print *, "String we read from is: ", string
10 Read(string,1) x
11 1 Format(BZ,B8)
12 If (x/=Int(b'11111100')) Then
13 Print *,'FAIL B8 BZ wrong result'
14 Print *,'Expected',Int(b'11111100')
15 Print *,'Received',x
16 ok = .False.
17 End If
18 string = '123456'
19 !print *, "String we read from is: ", string
20 Read(string,2) x
21 2 Format(BZ,I8)
22 If (x/=12345600) Then
23 Print *,'FAIL I8 BZ wrong result'
24 Print *,'Expected',12345600
25 Print *,'Received',x
26 ok = .False.
27 End If
28 Read(string,3) x
29 3 Format(BZ,O8)
30 If (x/=Int(o'12345600')) Then
31 Print *,'FAIL O8 BZ wrong result'
32 Print *,'Expected',Int(o'12345600')
33 Print *,'Received',x
34 ok = .False.
35 End If
36 Read(string,4) x
37 4 Format(BZ,Z8)
38 If (x/=Int(z'12345600')) Then
39 Print *,'FAIL OZ BZ wrong result'
40 Print *,'Expected',Int(z'12345600')
41 Print *,'Received',x
42 ok = .False.
43 End If
44 If (.not. ok) stop 1
45 End Program