diff --git a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp index 5ea6c6bc0758b9..ee8686d1166a5b 100644 --- a/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp +++ b/llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp @@ -1157,8 +1157,8 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser { Inst.setOpcode(Opc64); } } - if (!SkipTypeCheck && TC.typeCheck(IDLoc, Inst, Operands)) - return true; + if (!SkipTypeCheck) + TC.typeCheck(IDLoc, Inst, Operands); Out.emitInstruction(Inst, getSTI()); if (CurrentState == EndFunction) { onEndOfFunction(IDLoc); diff --git a/llvm/test/MC/WebAssembly/annotations-typecheck.s b/llvm/test/MC/WebAssembly/annotations-typecheck.s new file mode 100644 index 00000000000000..1fcdb9c0e35878 --- /dev/null +++ b/llvm/test/MC/WebAssembly/annotations-typecheck.s @@ -0,0 +1,11 @@ +# RUN: not llvm-mc -triple=wasm32-unknown-unknown < %s | FileCheck %s + +# This tests annotations are handled correctly even if there is a type checking +# error (which are unrelated to the block annotations). +test_annotation: + .functype test_annotation () -> () + block (i32) -> () + drop +# CHECK-NOT: # End marker mismatch! + end_block + end_function