111
|
1 ! { dg-do run }
|
|
2 ! PR69651 Usage of unitialized pointer io/list_read.c
|
|
3 ! Note: The uninitialized pointer was not the cause of the problem
|
|
4 ! observed with this test case. The problem was mishandling '!'
|
|
5 ! See also test case read_bang4.f90.
|
|
6 program test
|
|
7 implicit none
|
|
8 integer :: i, j, ios
|
|
9 real :: r, s
|
|
10 complex :: c, d
|
|
11 character(20) :: str1, str2
|
|
12
|
|
13 i = -5
|
|
14 j = -6
|
|
15 r = -3.14
|
|
16 s = -2.71
|
|
17 c = (-1.1,-2.2)
|
|
18 d = (-3.3,-4.4)
|
|
19 str1 = "candy"
|
|
20 str2 = "peppermint"
|
|
21 open(15, status='scratch')
|
|
22 write(15,*) "10 1!2"
|
|
23 write(15,*) " 23.5! 34.5"
|
|
24 write(15,*) " (67.50,69.25) (51.25,87.75)!"
|
|
25 write(15,*) " 'abcdefgh!' ' !klmnopq!'"
|
|
26 rewind(15)
|
|
27 read(15,*,iostat=ios) i, j
|
131
|
28 if (ios.ne.5010) STOP 1
|
111
|
29 read(15,*,iostat=ios) r, s
|
131
|
30 if (ios.ne.5010) STOP 2
|
111
|
31 read(15,*,iostat=ios) c, d
|
131
|
32 if (ios.ne.5010) STOP 3
|
111
|
33 read(15,*,iostat=ios) str1, str2
|
131
|
34 if (ios.ne.0) STOP 4
|
111
|
35 if (str1.ne."abcdefgh!") print *, str1
|
|
36 if (str2.ne." !klmnopq!") print *, str2
|
|
37 close(15)
|
|
38 end program
|