Index: test/CodeGen/AArch64/mature-mc-support.ll =================================================================== --- test/CodeGen/AArch64/mature-mc-support.ll +++ test/CodeGen/AArch64/mature-mc-support.ll @@ -9,4 +9,4 @@ module asm " .this_directive_is_very_unlikely_to_exist" -; CHECK: LLVM ERROR: Error parsing inline asm +; CHECK: error: unknown directive Index: test/CodeGen/ARM/mature-mc-support.ll =================================================================== --- test/CodeGen/ARM/mature-mc-support.ll +++ test/CodeGen/ARM/mature-mc-support.ll @@ -9,4 +9,4 @@ module asm " .this_directive_is_very_unlikely_to_exist" -; CHECK: LLVM ERROR: Error parsing inline asm +; CHECK: error: unknown directive Index: test/CodeGen/Mips/mature-mc-support.ll =================================================================== --- test/CodeGen/Mips/mature-mc-support.ll +++ test/CodeGen/Mips/mature-mc-support.ll @@ -29,4 +29,4 @@ module asm " .this_directive_is_very_unlikely_to_exist" -; CHECK: LLVM ERROR: Error parsing inline asm +; CHECK: error: unknown directive Index: test/CodeGen/PowerPC/mature-mc-support.ll =================================================================== --- test/CodeGen/PowerPC/mature-mc-support.ll +++ test/CodeGen/PowerPC/mature-mc-support.ll @@ -28,4 +28,4 @@ module asm " .this_directive_is_very_unlikely_to_exist" -; CHECK: LLVM ERROR: Error parsing inline asm +; CHECK: error: unknown directive Index: test/CodeGen/SPARC/mature-mc-support.ll =================================================================== --- test/CodeGen/SPARC/mature-mc-support.ll +++ test/CodeGen/SPARC/mature-mc-support.ll @@ -17,4 +17,4 @@ module asm " .this_directive_is_very_unlikely_to_exist" -; CHECK: LLVM ERROR: Error parsing inline asm +; CHECK: error: unknown directive Index: test/CodeGen/SystemZ/mature-mc-support.ll =================================================================== --- test/CodeGen/SystemZ/mature-mc-support.ll +++ test/CodeGen/SystemZ/mature-mc-support.ll @@ -12,4 +12,4 @@ module asm " .this_directive_is_very_unlikely_to_exist" -; CHECK: LLVM ERROR: Error parsing inline asm +; CHECK: error: unknown directive Index: test/CodeGen/Thumb/mature-mc-support.ll =================================================================== --- test/CodeGen/Thumb/mature-mc-support.ll +++ test/CodeGen/Thumb/mature-mc-support.ll @@ -9,4 +9,4 @@ module asm " .this_directive_is_very_unlikely_to_exist" -; CHECK: LLVM ERROR: Error parsing inline asm +; CHECK: error: unknown directive Index: test/CodeGen/X86/mature-mc-support.ll =================================================================== --- test/CodeGen/X86/mature-mc-support.ll +++ test/CodeGen/X86/mature-mc-support.ll @@ -15,4 +15,4 @@ module asm " .this_directive_is_very_unlikely_to_exist" -; CHECK: LLVM ERROR: Error parsing inline asm +; CHECK: error: unknown directive Index: tools/llc/llc.cpp =================================================================== --- tools/llc/llc.cpp +++ tools/llc/llc.cpp @@ -253,6 +253,15 @@ errs() << "\n"; } +static void InlineAsmDiagHandler(const SMDiagnostic &SMD, void *Context, + unsigned) { + bool *HasError = static_cast(Context); + if (SMD.getKind() == SourceMgr::DK_Error) + *HasError = true; + + SMD.print(nullptr, errs()); +} + // main - Entry point for the llc compiler. // int main(int argc, char **argv) { @@ -294,6 +303,8 @@ // Set a diagnostic handler that doesn't exit on the first error bool HasError = false; Context.setDiagnosticHandler(DiagnosticHandler, &HasError); + Context.setInlineAsmDiagnosticHandler(InlineAsmDiagHandler, &HasError); + if (PassRemarksWithHotness) Context.setDiagnosticHotnessRequested(true);