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 integer value}}
31 func.func private @it3() -> !fir.complex<>
35 // expected-error@+1 {{expected non-function type}}
36 func.func private @mem3() -> !fir.heap<>
40 // expected-error@+1 {{expected integer value}}
41 func.func private @it1() -> !fir.int<A>
45 // expected-error@+1 {{expected integer value}}
46 func.func private @it1() -> !fir.logical<b>
50 // expected-error@+1 {{expected non-function type}}
51 func.func private @mem3() -> !fir.ptr<>
55 // expected-error@+1 {{expected integer value}}
56 func.func private @mem3() -> !fir.real<>
60 // expected-error@+1 {{expected valid keyword}}
61 func.func private @mem3() -> !fir.type<>
65 // expected-error@+2 {{expected valid keyword}}
66 // expected-error@+1 {{expected LEN parameter list}}
67 func.func private @dvd4() -> !fir.type<derived4()>
71 // expected-error@+2 {{expected ':'}}
72 // expected-error@+1 {{expected LEN parameter list}}
73 func.func private @dvd4() -> !fir.type<derived4(p)>
77 // expected-error@+2 {{expected non-function type}}
78 // expected-error@+1 {{expected LEN parameter list}}
79 func.func private @dvd4() -> !fir.type<derived4(p:)>
83 // expected-error@+2 {{expected valid keyword}}
84 // expected-error@+1 {{expected field type list}}
85 func.func private @dvd4() -> !fir.type<derived4(p:i8){}>
89 // expected-error@+2 {{expected ':'}}
90 // expected-error@+1 {{expected field type list}}
91 func.func private @dvd4() -> !fir.type<derived4(p:i8){f1}>
95 // expected-error@+2 {{expected non-function type}}
96 // expected-error@+1 {{expected field type list}}
97 func.func private @dvd4() -> !fir.type<derived4(p:i8){f1:f2}>
101 // expected-error@+2 {{expected valid keyword}}
102 // expected-error@+1 {{expected field type list}}
103 func.func private @dvd4() -> !fir.type<derived4(p:i8){f1:i32,}>
107 // expected-error@+2 {{expected valid keyword}}
108 // expected-error@+1 {{expected field type list}}
109 func.func private @dvd4() -> !fir.type<derived4(p:i8){,}>
113 // expected-error@+1 {{expected non-function type}}
114 func.func private @mem3() -> !fir.ref<>
118 // expected-error@+1 {{expected ':'}}
119 func.func private @arr1() -> !fir.array<*>
123 // expected-error@+1 {{expected non-function type}}
124 func.func private @arr1() -> !fir.array<*:>
128 // expected-error@+1 {{expected integer value}}
129 func.func private @oth1() -> !fir.shape<>
133 // expected-error@+1 {{expected integer value}}
134 func.func private @oth1() -> !fir.shapeshift<>
138 // expected-error@+1 {{expected integer value}}
139 func.func private @oth1() -> !fir.shift<>
143 // expected-error@+1 {{expected integer value}}
144 func.func private @oth1() -> !fir.slice<>
148 // expected-error@+1 {{expected non-function type}}
149 func.func private @oth3() -> !fir.tdesc<xx>
153 // expected-error@+1 {{expected integer value}}
154 func.func private @oth3() -> !fir.vector<>
158 // expected-error@+1 {{expected ':'}}
159 func.func private @oth3() -> !fir.vector<10>
163 // expected-error@+1 {{expected non-function type}}
164 func.func private @oth3() -> !fir.vector<10:>
168 // expected-error@+1 {{invalid element type}}
169 func.func private @upe() -> !fir.class<!fir.box<i32>>