annotate gcc/testsuite/gfortran.dg/duplicate_labels.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 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! PR 21257
kono
parents:
diff changeset
3 program dups
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 integer i,j,k
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 abc: do i = 1, 3
kono
parents:
diff changeset
8 abc: do j = 1, 3 ! { dg-error "Duplicate construct label" }
kono
parents:
diff changeset
9 k = i + j
kono
parents:
diff changeset
10 end do abc
kono
parents:
diff changeset
11 end do abc ! { dg-error "Expecting END PROGRAM" }
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 xyz: do i = 1, 2
kono
parents:
diff changeset
14 k = i + 2
kono
parents:
diff changeset
15 end do xyz
kono
parents:
diff changeset
16 xyz: do j = 1, 5 ! { dg-error "Duplicate construct label" }
kono
parents:
diff changeset
17 k = j + 2
kono
parents:
diff changeset
18 end do loop ! { dg-error "Expecting END PROGRAM" }
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 her: if (i == 1) then
kono
parents:
diff changeset
21 her: if (j == 1) then ! { dg-error "Duplicate construct label" }
kono
parents:
diff changeset
22 k = i + j
kono
parents:
diff changeset
23 end if her
kono
parents:
diff changeset
24 end if her ! { dg-error "Expecting END PROGRAM" }
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 his: if (i == 1) then
kono
parents:
diff changeset
27 i = j
kono
parents:
diff changeset
28 end if his
kono
parents:
diff changeset
29 his: if (j === 1) then ! { dg-error "Duplicate construct label" }
kono
parents:
diff changeset
30 print *, j
kono
parents:
diff changeset
31 end if his ! { dg-error "Expecting END PROGRAM" }
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 sgk: select case (i)
kono
parents:
diff changeset
34 case (1)
kono
parents:
diff changeset
35 sgk: select case (j) ! { dg-error "Duplicate construct label" }
kono
parents:
diff changeset
36 case (10)
kono
parents:
diff changeset
37 i = i + j
kono
parents:
diff changeset
38 case (20)
kono
parents:
diff changeset
39 j = j + i
kono
parents:
diff changeset
40 end select sgk
kono
parents:
diff changeset
41 case (2) ! { dg-error "Unexpected CASE statement" }
kono
parents:
diff changeset
42 i = i + 1
kono
parents:
diff changeset
43 j = j + 1
kono
parents:
diff changeset
44 end select sgk ! { dg-error "Expecting END PROGRAM" }
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 apl: select case (i)
kono
parents:
diff changeset
47 case (1)
kono
parents:
diff changeset
48 k = 2
kono
parents:
diff changeset
49 case (2)
kono
parents:
diff changeset
50 j = 1
kono
parents:
diff changeset
51 end select apl
kono
parents:
diff changeset
52 apl: select case (i) ! { dg-error "Duplicate construct label" }
kono
parents:
diff changeset
53 case (1) ! { dg-error "Unexpected CASE statement" }
kono
parents:
diff changeset
54 j = 2
kono
parents:
diff changeset
55 case (2) ! { dg-error "Unexpected CASE statement" }
kono
parents:
diff changeset
56 k = 1
kono
parents:
diff changeset
57 end select apl ! { dg-error "Expecting END PROGRAM" }
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 end program dups