[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / implicit11.f90
blob0a52e1ac9d26f9cb1239bced09daf5a904783f96
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
4 ! Test use of implicitly declared variable in specification expression
6 subroutine s1()
7 m = 1
8 contains
9 subroutine s1a()
10 implicit none
11 !ERROR: No explicit type declared for 'n'
12 real :: a(m, n)
13 end
14 subroutine s1b()
15 !ERROR: Implicitly typed local entity 'n' not allowed in specification expression
16 real :: a(m, n)
17 end
18 end
20 subroutine s2()
21 type :: t(m, n)
22 integer, len :: m
23 integer, len :: n
24 end type
25 n = 1
26 contains
27 subroutine s2a()
28 !ERROR: Implicitly typed local entity 'm' not allowed in specification expression
29 type(t(m, n)) :: a
30 end
31 subroutine s2b()
32 implicit none
33 !ERROR: No explicit type declared for 'm'
34 character(m) :: a
35 end
36 end
38 subroutine s3()
39 m = 1
40 contains
41 subroutine s3a()
42 implicit none
43 real :: a(m, n)
44 !ERROR: No explicit type declared for 'n'
45 common n
46 end
47 subroutine s3b()
48 ! n is okay here because it is in a common block
49 real :: a(m, n)
50 common n
51 end
52 end
54 subroutine s4()
55 implicit none
56 contains
57 subroutine s4a()
58 !ERROR: No explicit type declared for 'n'
59 real :: a(n)
60 end
61 end