forked from OSchip/llvm-project
Return error status when number of operands don't match while parsing.
Previously an error would be emitted but parsing would continue as false was being returned. PiperOrigin-RevId: 212192167
This commit is contained in:
parent
9afa796d42
commit
d101fb937b
|
@ -1832,8 +1832,8 @@ public:
|
|||
}
|
||||
|
||||
if (requiredOperandCount != -1 && result.size() != requiredOperandCount)
|
||||
emitError(startLoc,
|
||||
"expected " + Twine(requiredOperandCount) + " operands");
|
||||
return emitError(startLoc,
|
||||
"expected " + Twine(requiredOperandCount) + " operands");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,3 +121,10 @@ mlfunc @calls(%arg0 : i32) {
|
|||
%x = call @calls() : () -> i32 // expected-error {{reference to function with mismatched type}}
|
||||
return
|
||||
}
|
||||
|
||||
// -----
|
||||
|
||||
cfgfunc @cfgfunc_with_ops(f32) {
|
||||
bb0(%a : f32):
|
||||
%sf = addf(%a, %a) : f32 // expected-error {{custom op 'addf' expected 2 operands}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue