[lldb] Fix "exact match" debug_names type queries (#118465)
[llvm-project.git] / flang / test / Semantics / resolve33.f90
blob88ebd1be4637b202a2f002bf7ed68b576da603f9
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Derived type parameters
3 ! C731 The same type-param-name shall not appear more than once in a given
4 ! derived-type-stmt.
5 ! C741 A type-param-name in a type-param-def-stmt in a derived-type-def shall
6 ! be one of the type-paramnames in the derived-type-stmt of that
7 ! derived-type-def.
8 ! C742 Each type-param-name in the derived-type-stmt in a derived-type-def
9 ! shall appear exactly once as a type-param-name in a type-param-def-stmt
10 ! in that derived-type-def.
12 module m
13 !ERROR: Type parameter, component, or procedure binding 'a' already defined in this type
14 type t1(a, b, a)
15 integer, kind :: a
16 integer(8), len :: b
17 end type
18 !ERROR: No definition found for type parameter 'b'
19 type t2(a, b, c)
20 integer, kind :: a
21 integer, len :: c
22 end type
23 !ERROR: No definition found for type parameter 'b'
24 type t3(a, b)
25 integer, kind :: a
26 !ERROR: Component 'b' is already declared in this derived type
27 integer :: b
28 end type
29 type t4(a)
30 integer, kind :: a
31 !ERROR: 'd' is not a 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 'a' was already declared in this derived 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 !ERROR: Type parameter 'k' was referenced before being declared
44 !ERROR: Type parameter 'l' was referenced before being declared
45 character(kind=k, len=l) :: d3
46 end type
47 type(t6(2, 10)) :: x3
48 type :: t7(k1,k2)
49 !ERROR: Type parameter 'k2' was referenced before being declared
50 integer(kind(k2)), kind :: k1
51 integer(kind(k1)), kind :: k2
52 end type
53 end module