Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / stop01.f90
blobcf7b0056b9b92509d7e7d841eabdbc70ca387916
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 program main
3 implicit none
4 integer :: i = -1
5 integer, pointer :: p_i
6 integer(kind = 1) :: invalid = 0
7 integer, dimension(1:100) :: iarray
8 integer, dimension(:), pointer :: p_iarray
9 integer, allocatable, dimension(:) :: aiarray
10 logical :: l = .false.
11 logical, dimension(1:100) :: larray
12 logical, allocatable, dimension(:) :: alarray
13 character(len = 128) :: chr1
14 character(kind = 4, len = 128) :: chr2
16 if (i .eq. 0) stop "Stop."
17 if (i .eq. 0) stop "Stop."(1:4)
18 if (i .eq. 0) stop chr1
19 !ERROR: CHARACTER stop code must be of default kind
20 if (i .eq. 0) stop chr2
21 if (i .eq. 0) stop 1
22 if (i .eq. 0) stop 1 + 2
23 if (i .eq. 0) stop i
24 if (i .eq. 0) stop p_i
25 if (i .eq. 0) stop p_iarray(1)
26 if (i .eq. 0) stop iarray(1)
27 if (i .eq. 0) stop aiarray(1)
28 if (i .eq. 0) stop 1 + i
29 !ERROR: INTEGER stop code must be of default kind
30 if (i .eq. 0) stop invalid
31 !ERROR: Stop code must be of INTEGER or CHARACTER type
32 if (i .eq. 0) stop 12.34
33 if (i .eq. 0) stop 1, quiet = .true.
34 if (i .eq. 0) stop 2, quiet = .false.
35 if (i .eq. 0) stop 3, quiet = l
36 if (i .eq. 0) stop 3, quiet = .not. l
37 if (i .eq. 0) stop 3, quiet = larray(1)
38 if (i .eq. 0) stop , quiet = .false.
39 if (i .eq. 0) error stop "Error."
40 if (i .eq. 0) error stop chr1
41 !ERROR: CHARACTER stop code must be of default kind
42 if (i .eq. 0) error stop chr2
43 if (i .eq. 0) error stop 1
44 if (i .eq. 0) error stop i
45 if (i .eq. 0) error stop p_i
46 if (i .eq. 0) error stop p_iarray(1)
47 if (i .eq. 0) error stop iarray(1)
48 if (i .eq. 0) error stop aiarray(1)
49 if (i .eq. 0) error stop 1 + i
50 !ERROR: INTEGER stop code must be of default kind
51 if (i .eq. 0) error stop invalid
52 !ERROR: Stop code must be of INTEGER or CHARACTER type
53 if (i .eq. 0) error stop 12.34
54 if (i .eq. 0) error stop 1, quiet = .true.
55 if (i .eq. 0) error stop 2, quiet = .false.
56 if (i .eq. 0) error stop 3, quiet = l
57 if (i .eq. 0) error stop 3, quiet = .not. l
58 if (i .eq. 0) error stop 3, quiet = larray(1)
59 if (i .eq. 0) error stop , quiet = .false.
60 stop
61 end program