Debian Codegraph @

gcc/testsuite/gfortran.dg/gomp/imperfect-gotos.f90

raw
1 ! This test case is expected to fail due to errors.
2
3 ! These jumps are all OK since they are to/from the same structured block.
4 subroutine f1 ()
5 integer :: i, j
6 !$omp do collapse(2)
7 do i = 1, 64
8 go to 10
9 10 continue
10 do j = 1, 64
11 go to 11
12 11 continue
13 end do
14 go to 12
15 12 continue
16 end do
17 end subroutine
18
19 ! Jump around loop body to/from different structured blocks of intervening
20 ! code.
21 subroutine f2 ()
22 integer :: i, j
23 !$omp do collapse(2)
24 do i = 1, 64
25 go to 20
26 20 continue
27 if (i > 16) go to 22 ! { dg-error "invalid branch to/from OpenMP structured block" }
28 do j = 1, 64
29 go to 21
30 21 continue
31 end do
32 go to 22
33 22 continue
34 end do
35 end subroutine
36
37 ! Jump into loop body from intervening code.
38 subroutine f3 ()
39 integer :: i, j
40 !$omp do collapse(2)
41 do i = 1, 64
42 go to 30
43 30 continue
44 if (i > 16) go to 31 ! { dg-error "invalid branch to/from OpenMP structured block" }
45 ! { dg-warning "Legacy Extension:" "" { target *-*-* } .-1 }
46 do j = 1, 64
47 go to 31
48 31 continue ! { dg-warning "Legacy Extension:" }
49 end do
50 go to 32
51 32 continue
52 end do
53 end subroutine
54
55 ! Jump out of loop body to intervening code.
56 subroutine f4 ()
57 integer :: i, j
58 !$omp do collapse(2)
59 do i = 1, 64
60 go to 40
61 40 continue
62 do j = 1, 64
63 if (i > 16) go to 41 ! { dg-error "invalid branch to/from OpenMP structured block" }
64 end do
65 41 continue
66 go to 42
67 42 continue
68 end do
69 end subroutine