diff --git a/system-tests/fortran/configuration.ini b/system-tests/fortran/configuration.ini index 5aee99f..f1061d2 100644 --- a/system-tests/fortran/configuration.ini +++ b/system-tests/fortran/configuration.ini @@ -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 diff --git a/system-tests/fortran/expected.labelled_exits.txt b/system-tests/fortran/expected.labelled_exits.txt new file mode 100644 index 0000000..1268c43 --- /dev/null +++ b/system-tests/fortran/expected.labelled_exits.txt @@ -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. diff --git a/system-tests/fortran/labelled_exits.f90 b/system-tests/fortran/labelled_exits.f90 new file mode 100644 index 0000000..7d126f5 --- /dev/null +++ b/system-tests/fortran/labelled_exits.f90 @@ -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 \ No newline at end of file