annotate gcc/testsuite/gfortran.dg/read_bang.f90 @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do run }
kono
parents:
diff changeset
2 ! PR69651 Usage of unitialized pointer io/list_read.c
kono
parents:
diff changeset
3 ! Note: The uninitialized pointer was not the cause of the problem
kono
parents:
diff changeset
4 ! observed with this test case. The problem was mishandling '!'
kono
parents:
diff changeset
5 ! See also test case read_bang4.f90.
kono
parents:
diff changeset
6 program test
kono
parents:
diff changeset
7 implicit none
kono
parents:
diff changeset
8 integer :: i, j, ios
kono
parents:
diff changeset
9 real :: r, s
kono
parents:
diff changeset
10 complex :: c, d
kono
parents:
diff changeset
11 character(20) :: str1, str2
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 i = -5
kono
parents:
diff changeset
14 j = -6
kono
parents:
diff changeset
15 r = -3.14
kono
parents:
diff changeset
16 s = -2.71
kono
parents:
diff changeset
17 c = (-1.1,-2.2)
kono
parents:
diff changeset
18 d = (-3.3,-4.4)
kono
parents:
diff changeset
19 str1 = "candy"
kono
parents:
diff changeset
20 str2 = "peppermint"
kono
parents:
diff changeset
21 open(15, status='scratch')
kono
parents:
diff changeset
22 write(15,*) "10 1!2"
kono
parents:
diff changeset
23 write(15,*) " 23.5! 34.5"
kono
parents:
diff changeset
24 write(15,*) " (67.50,69.25) (51.25,87.75)!"
kono
parents:
diff changeset
25 write(15,*) " 'abcdefgh!' ' !klmnopq!'"
kono
parents:
diff changeset
26 rewind(15)
kono
parents:
diff changeset
27 read(15,*,iostat=ios) i, j
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
28 if (ios.ne.5010) STOP 1
111
kono
parents:
diff changeset
29 read(15,*,iostat=ios) r, s
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
30 if (ios.ne.5010) STOP 2
111
kono
parents:
diff changeset
31 read(15,*,iostat=ios) c, d
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
32 if (ios.ne.5010) STOP 3
111
kono
parents:
diff changeset
33 read(15,*,iostat=ios) str1, str2
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
34 if (ios.ne.0) STOP 4
111
kono
parents:
diff changeset
35 if (str1.ne."abcdefgh!") print *, str1
kono
parents:
diff changeset
36 if (str2.ne." !klmnopq!") print *, str2
kono
parents:
diff changeset
37 close(15)
kono
parents:
diff changeset
38 end program