Skip to content

Commit

Permalink
MetOffice#20 LabelledExits system test
Browse files Browse the repository at this point in the history
  • Loading branch information
bilal-chughtai committed Feb 24, 2022
1 parent 74cfa19 commit 440c78c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system-tests/fortran/configuration.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ rules = MissingPointerInit
[style.wrong_kind]
rules = KindPattern(integer=r'.*_jazz', real=r'.*_metal')

[style.labelled_exits]
rules = LabelledExits

[style.multiple]
rules = FortranCharacterset, MissingImplicit(require_everywhere=True), MissingPointerInit
5 changes: 5 additions & 0 deletions system-tests/fortran/expected.labelled_exits.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
stdout
Found 2 issues
stderr
$$/labelled_exits.f90: 4: Usage of "exit" without label indicating which do construct is being exited from.
$$/labelled_exits.f90: 10: Usage of "exit" without label indicating which do construct is being exited from.
15 changes: 15 additions & 0 deletions system-tests/fortran/labelled_exits.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
program test_program
integer :: i, j
a : do i = 1, 3
exit
end do a
b : do i = 1, 3
exit b
end do b
c : do i = 1, 3
if (i==2) exit
end do c
d : do i = 1, 3
if (i==2) exit d
end do d
end program test_program

0 comments on commit 440c78c

Please # to comment.