libgfortran/ChangeLog:
[official-gcc.git] / gcc / testsuite / gfortran.dg / goto_3.f90
blob918443abbd9524c4a8737d535c025972c0983285
1 ! { dg-do compile }
2 ! Verify that various cases of invalid branches are rejected
3 dimension a(10)
4 if (i>0) then
5 goto 10 ! { dg-error "not a valid branch target statement" }
6 10 else ! { dg-error "not a valid branch target statement" }
7 i = -i
8 end if
10 goto 20 ! { dg-error "not a valid branch target statement" }
11 forall (i=1:10)
12 a(i) = 2*i
13 20 end forall ! { dg-error "not a valid branch target statement" }
15 goto 30 ! { dg-error "not a valid branch target statement" }
16 goto 40 ! { dg-error "not a valid branch target statement" }
17 where (a>0)
18 a = 2*a
19 30 elsewhere ! { dg-error "not a valid branch target statement" }
20 a = a/2
21 40 end where ! { dg-error "not a valid branch target statement" }
22 end