c++: constrained lambda error-recovery [PR108972]
[official-gcc.git] / gcc / testsuite / gfortran.dg / goto_5.f90
blob44ba697249246670543d20ad7ba589d824ede6cd
1 ! { dg-do compile }
2 ! PR 38507
3 ! Verify that we correctly flag invalid gotos, while not flagging valid gotos.
4 integer i,j
6 do i=1,10
7 goto 20
8 20 end do ! { dg-warning "is not in the same block" }
10 goto 20 ! { dg-warning "is not in the same block" }
11 goto 25 ! { dg-warning "is not in the same block" }
12 goto 40 ! { dg-warning "is not in the same block" }
13 goto 50 ! { dg-warning "is not in the same block" }
15 goto 222
16 goto 333
17 goto 444
19 222 if (i < 0) then
20 25 end if ! { dg-warning "is not in the same block" }
22 333 if (i > 0) then
23 do j = 1,20
24 goto 30
25 end do
26 else if (i == 0) then
27 goto 30
28 else
29 goto 30
30 30 end if
32 444 select case(i)
33 case(0)
34 goto 50
35 goto 60 ! { dg-warning "is not in the same block" }
36 case(1)
37 goto 40
38 goto 50
39 40 continue ! { dg-warning "is not in the same block" }
40 60 continue ! { dg-warning "is not in the same block" }
41 50 end select ! { dg-warning "is not in the same block" }
42 continue
44 end