1 // Test the FIR types parser diagnostics
2 // RUN: fir-opt -split-input-file -verify-diagnostics %s
4 // expected-error@+1 {{expected non-function type}}
5 func.func private @box3() -> !fir.boxproc<>
9 // expected-error@+2 {{expected non-function type}}
10 // expected-error@+1 {{failed to parse fir_BoxType parameter 'eleTy' which is to be a `mlir::Type`}}
11 func.func private @box1() -> !fir.box<>
15 // expected-error@+1 {{expected integer value}}
16 func.func private @box2() -> !fir.boxchar<>
20 // expected-error@+1 {{expected integer value}}
21 func.func private @it6() -> !fir.char<>
25 // expected-error@+1 {{expected integer value}}
26 func.func private @it6() -> !fir.char<2, >
30 // expected-error@+1 {{expected non-function type}}
31 func.func private @mem3() -> !fir.heap<>
35 // expected-error@+1 {{expected integer value}}
36 func.func private @it1() -> !fir.int<A>
40 // expected-error@+1 {{expected integer value}}
41 func.func private @it1() -> !fir.logical<b>
45 // expected-error@+1 {{expected non-function type}}
46 func.func private @mem3() -> !fir.ptr<>
50 // expected-error@+1 {{expected valid keyword}}
51 func.func private @mem3() -> !fir.type<>
55 // expected-error@+2 {{expected valid keyword}}
56 // expected-error@+1 {{expected LEN parameter list}}
57 func.func private @dvd4() -> !fir.type<derived4()>
61 // expected-error@+2 {{expected ':'}}
62 // expected-error@+1 {{expected LEN parameter list}}
63 func.func private @dvd4() -> !fir.type<derived4(p)>
67 // expected-error@+2 {{expected non-function type}}
68 // expected-error@+1 {{expected LEN parameter list}}
69 func.func private @dvd4() -> !fir.type<derived4(p:)>
73 // expected-error@+2 {{expected valid keyword}}
74 // expected-error@+1 {{expected field type list}}
75 func.func private @dvd4() -> !fir.type<derived4(p:i8){}>
79 // expected-error@+2 {{expected ':'}}
80 // expected-error@+1 {{expected field type list}}
81 func.func private @dvd4() -> !fir.type<derived4(p:i8){f1}>
85 // expected-error@+2 {{expected non-function type}}
86 // expected-error@+1 {{expected field type list}}
87 func.func private @dvd4() -> !fir.type<derived4(p:i8){f1:f2}>
91 // expected-error@+2 {{expected valid keyword}}
92 // expected-error@+1 {{expected field type list}}
93 func.func private @dvd4() -> !fir.type<derived4(p:i8){f1:i32,}>
97 // expected-error@+2 {{expected valid keyword}}
98 // expected-error@+1 {{expected field type list}}
99 func.func private @dvd4() -> !fir.type<derived4(p:i8){,}>
103 // expected-error@+1 {{expected non-function type}}
104 func.func private @mem3() -> !fir.ref<>
108 // expected-error@+1 {{expected ':'}}
109 func.func private @arr1() -> !fir.array<*>
113 // expected-error@+1 {{expected non-function type}}
114 func.func private @arr1() -> !fir.array<*:>
118 // expected-error@+1 {{expected integer value}}
119 func.func private @oth1() -> !fir.shape<>
123 // expected-error@+1 {{expected integer value}}
124 func.func private @oth1() -> !fir.shapeshift<>
128 // expected-error@+1 {{expected integer value}}
129 func.func private @oth1() -> !fir.shift<>
133 // expected-error@+1 {{expected integer value}}
134 func.func private @oth1() -> !fir.slice<>
138 // expected-error@+1 {{expected non-function type}}
139 func.func private @oth3() -> !fir.tdesc<xx>
143 // expected-error@+1 {{expected integer value}}
144 func.func private @oth3() -> !fir.vector<>
148 // expected-error@+1 {{expected ':'}}
149 func.func private @oth3() -> !fir.vector<10>
153 // expected-error@+1 {{expected non-function type}}
154 func.func private @oth3() -> !fir.vector<10:>
158 // expected-error@+1 {{invalid element type}}
159 func.func private @upe() -> !fir.class<!fir.box<i32>>
163 // expected-error@+1 {{invalid element type}}
164 func.func private @upe() -> !fir.box<!fir.class<none>>