• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// RUN: mlir-opt %s -split-input-file -verify-diagnostics
2
3// -----
4// Invalid type.
5// expected-error@+1 {{unknown quantized type foobar}}
6!qalias = type !quant.foobar
7
8// -----
9// Unrecognized token: illegal token
10// expected-error@+1 {{unknown quantized type __}}
11!qalias = type !quant.__
12
13// -----
14// Unrecognized token: trailing
15// expected-error@+1 {{expected '>'}}
16!qalias = type !quant.uniform<i8<-4:3>:f32, 0.99872:127 23>
17
18// -----
19// Unrecognized token: missing storage type maximum
20// expected-error@+1 {{expected ':'}}
21!qalias = type !quant.uniform<i8<16>:f32, 0.99872:127>
22
23// -----
24// Unrecognized token: missing closing angle bracket
25// expected-error@+1 {{expected '>'}}
26!qalias = type !quant<"uniform<i8<-4:3:f32, 0.99872:127>">
27
28// -----
29// Unrecognized token: missing type colon
30// expected-error@+1 {{expected ':'}}
31!qalias = type !quant.uniform<i8<-4:3>f32, 0.99872:127>
32
33// -----
34// Unrecognized token: missing comma
35// expected-error@+1 {{expected ','}}
36!qalias = type !quant.uniform<i8<-4:3>:f32 0.99872:127>
37
38// -----
39// Unrecognized storage type: illegal prefix
40// expected-error@+1 {{illegal storage type prefix}}
41!qalias = type !quant.uniform<int8<-4:3>:f32, 0.99872:127>
42
43// -----
44// Unrecognized storage type: no width
45// expected-error@+1 {{illegal storage type prefix}}
46!qalias = type !quant.uniform<i<-4:3>:f32, 0.99872:127>
47
48// -----
49// Unrecognized storage type: storage size > 32
50// expected-error@+1 {{illegal storage type size: 33}}
51!qalias = type !quant.uniform<i33:f32, 0.99872:127>
52
53// -----
54// Unrecognized storage type: storage size < 0
55// expected-error@+1 {{illegal storage type prefix}}
56!qalias = type !quant.uniform<i-1<-4:3>:f32, 0.99872:127>
57
58// -----
59// Unrecognized storage type: storage size == 0
60// expected-error@+1 {{invalid integer width}}
61!qalias = type !quant.uniform<i0<-4:3>:f32, 0.99872:127>
62
63// -----
64// Illegal storage min/max: max - min < 0
65// expected-error@+1 {{illegal storage min and storage max: (2:1)}}
66!qalias = type !quant.uniform<i8<2:1>:f32, 0.99872:127>
67
68// -----
69// Illegal storage min/max: max - min == 0
70// expected-error@+1 {{illegal storage min and storage max: (1:1)}}
71!qalias = type !quant.uniform<i8<1:1>:f32, 0.99872:127>
72
73// -----
74// Illegal storage min/max: max > defaultMax
75// expected-error@+1 {{illegal storage type maximum: 9}}
76!qalias = type !quant.uniform<i4<-1:9>:f32, 0.99872:127>
77
78// -----
79// Illegal storage min/max: min < defaultMin
80// expected-error@+1 {{illegal storage type minimum: -9}}
81!qalias = type !quant.uniform<i4<-9:1>:f32, 0.99872:127>
82
83// -----
84// Illegal uniform params: invalid scale
85// expected-error@+1 {{expected floating point literal}}
86!qalias = type !quant.uniform<i8<-4:3>:f32, abc:127>
87
88// -----
89// Illegal uniform params: invalid zero point separator
90// expected-error@+1 {{expected '>'}}
91!qalias = type !quant.uniform<i8<-4:3>:f32, 0.1abc>
92
93// -----
94// Illegal uniform params: missing zero point
95// expected-error@+1 {{expected integer value}}
96!qalias = type !quant.uniform<i8<-4:3>:f32, 0.1:>
97
98// -----
99// Illegal uniform params: invalid zero point
100// expected-error@+1 {{expected integer value}}
101!qalias = type !quant.uniform<i8<-4:3>:f32, 0.1:abc>
102
103// -----
104// Illegal expressed type: f33
105// expected-error@+1 {{expected non-function type}}
106!qalias = type !quant.uniform<i8<-4:3>:f33, 0.99872:127>
107
108// -----
109// Illegal scale: negative
110// expected-error@+1 {{illegal scale: -1.000000}}
111!qalias = type !quant.uniform<i8<-4:3>:f32, -1.0:127>
112
113// -----
114// Illegal uniform params: missing quantized dimension
115// expected-error@+1 {{expected integer value}}
116!qalias = type !quant.uniform<i8<-4:3>:f32:, {2.000000e+02:-19.987200e-01:1}>
117
118// -----
119// Illegal uniform params: unspecified quantized dimension, when multiple scales
120// provided.
121// expected-error@+1 {{expected floating point literal}}
122!qalias = type !quant.uniform<i8<-4:3>:f32, {2.000000e+02,-19.987200e-01:1}>
123