44 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12! This test checks for semantic errors in error stop statements based on the3! statement specification in section 11.4 of the Fortran 2018 standard.4! The errors in this test would be hidden by the errors in5! the test error_stop01a.f90 if they were included in that file,6! and are thus tested here.7 8program test_error_stop9 implicit none10 11 integer int_code, int_array(1), int_coarray[*], array_coarray(1)[*]12 integer(kind=1) non_default_int_kind13 character(len=128) char_code, char_array(1), char_coarray[*], non_logical14 character(kind=4, len=128) non_default_char_kind15 logical bool, logical_array(1), logical_coarray[*], non_integer, non_character16 17 !___ non-standard-conforming statements _________________________18 19 !ERROR: Stop code must be of INTEGER or CHARACTER type20 error stop non_integer21 22 !ERROR: Stop code must be of INTEGER or CHARACTER type23 error stop non_character24 25 !ERROR: INTEGER stop code must be of default kind26 error stop non_default_int_kind27 28 !ERROR: CHARACTER stop code must be of default kind29 error stop non_default_char_kind30 31 !ERROR: Must be a scalar value, but is a rank-1 array32 error stop char_array33 34 !ERROR: Must be a scalar value, but is a rank-1 array35 error stop array_coarray(:)[1]36 37 !ERROR: Must have LOGICAL type, but is CHARACTER(KIND=1,LEN=128_8)38 error stop int_code, quiet=non_logical39 40 !ERROR: Must be a scalar value, but is a rank-1 array41 error stop int_code, quiet=logical_array42 43end program test_error_stop44