forked from OSchip/llvm-project
Add missing return post parse failure for the indices of a sparse attribute.
PiperOrigin-RevId: 229231462
This commit is contained in:
parent
38c2fe3158
commit
e0594ce732
|
@ -1102,6 +1102,8 @@ Attribute Parser::parseAttribute(Type type) {
|
|||
auto indicesEltType = builder.getIntegerType(32);
|
||||
auto indices =
|
||||
parseDenseElementsAttr(indicesEltType, type.isa<VectorType>());
|
||||
if (!indices)
|
||||
return nullptr;
|
||||
|
||||
if (parseToken(Token::comma, "expected ','"))
|
||||
return nullptr;
|
||||
|
|
|
@ -867,3 +867,9 @@ func @mi() {
|
|||
func @invalid_tensor_literal() {
|
||||
// expected-error @+1 {{expected '[' in tensor literal list}}
|
||||
"foof16"(){bar: sparse<vector<1x1x1xf16>, [[0, 0, 0]], -2.0]>} : () -> ()
|
||||
|
||||
// -----
|
||||
|
||||
func @invalid_tensor_literal() {
|
||||
// expected-error @+1 {{expected '[' or scalar constant inside tensor literal}}
|
||||
"fooi16"(){bar: sparse<tensor<2x2x2xi16>, [[1, 1, 0], [0, 1, 0], [0,, [[0, 0, 0]], [-2.0]>} : () -> ()
|
||||
|
|
Loading…
Reference in New Issue