Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / error_stop1b.f90
blob355a049560102b64827e05226ec2176ce0e47224
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! This test checks for semantic errors in error stop statements based on the
3 ! statement specification in section 11.4 of the Fortran 2018 standard.
4 ! The errors in this test would be hidden by the errors in
5 ! the test error_stop01a.f90 if they were included in that file,
6 ! and are thus tested here.
8 program test_error_stop
9 implicit none
11 integer int_code, int_array(1), int_coarray[*], array_coarray(1)[*]
12 integer(kind=1) non_default_int_kind
13 character(len=128) char_code, char_array(1), char_coarray[*], non_logical
14 character(kind=4, len=128) non_default_char_kind
15 logical bool, logical_array(1), logical_coarray[*], non_integer, non_character
17 !___ non-standard-conforming statements _________________________
19 !ERROR: Stop code must be of INTEGER or CHARACTER type
20 error stop non_integer
22 !ERROR: Stop code must be of INTEGER or CHARACTER type
23 error stop non_character
25 !ERROR: INTEGER stop code must be of default kind
26 error stop non_default_int_kind
28 !ERROR: CHARACTER stop code must be of default kind
29 error stop non_default_char_kind
31 !ERROR: Must be a scalar value, but is a rank-1 array
32 error stop char_array
34 !ERROR: Must be a scalar value, but is a rank-1 array
35 error stop array_coarray[1]
37 !ERROR: Must have LOGICAL type, but is CHARACTER(KIND=1,LEN=128_8)
38 error stop int_code, quiet=non_logical
40 !ERROR: Must be a scalar value, but is a rank-1 array
41 error stop int_code, quiet=logical_array
43 end program test_error_stop