[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / resolve33.f90
blob114479294c9dae14474c817ad0f9fb3b1ee75de4
1 ! RUN: %S/test_errors.sh %s %t %flang_fc1
2 ! REQUIRES: shell
3 ! Derived type parameters
4 ! C731 The same type-param-name shall not appear more than once in a given
5 ! derived-type-stmt.
6 ! C741 A type-param-name in a type-param-def-stmt in a derived-type-def shall
7 ! be one of the type-paramnames in the derived-type-stmt of that
8 ! derived-type-def.
9 ! C742 Each type-param-name in the derived-type-stmt in a derived-type-def
10 ! shall appear exactly once as a type-param-name in a type-param-def-stmt
11 ! in that derived-type-def.
13 module m
14 !ERROR: Duplicate type parameter name: 'a'
15 type t1(a, b, a)
16 integer, kind :: a
17 integer(8), len :: b
18 end type
19 !ERROR: No definition found for type parameter 'b'
20 type t2(a, b, c)
21 integer, kind :: a
22 integer, len :: c
23 end type
24 !ERROR: No definition found for type parameter 'b'
25 type t3(a, b)
26 integer, kind :: a
27 integer :: b
28 end type
29 type t4(a)
30 integer, kind :: a
31 !ERROR: 'd' is not a type parameter of this derived type
32 integer(8), len :: d
33 end type
34 type t5(a, b)
35 integer, len :: a
36 integer, len :: b
37 !ERROR: Type parameter, component, or procedure binding 'a' already defined in this type
38 integer, len :: a
39 end type
40 !ERROR: No definition found for type parameter 'k'
41 !ERROR: No definition found for type parameter 'l'
42 type :: t6(k, l)
43 character(kind=k, len=l) :: d3
44 end type
45 type(t6(2, 10)) :: x3
46 end module