From: Matt Arsenault Date: Mon, 4 Feb 2019 19:53:22 +0000 (+0000) Subject: GlobalISel: Fix CheckMachineFunction passing if ReadCheckFile files X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b14586049499a8a88ca768dd99844c488f7ace18;p=llvm GlobalISel: Fix CheckMachineFunction passing if ReadCheckFile files This could be tested, but the FileCheck library spams the error message to the console. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353081 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/CodeGen/GlobalISel/GISelMITest.h b/unittests/CodeGen/GlobalISel/GISelMITest.h index 32feb584f43..5ac81e227cd 100644 --- a/unittests/CodeGen/GlobalISel/GISelMITest.h +++ b/unittests/CodeGen/GlobalISel/GISelMITest.h @@ -195,7 +195,9 @@ static inline bool CheckMachineFunction(const MachineFunction &MF, SMLoc()); Regex PrefixRE = FC.buildCheckPrefixRegex(); std::vector CheckStrings; - FC.ReadCheckFile(SM, CheckFileText, PrefixRE, CheckStrings); + if (FC.ReadCheckFile(SM, CheckFileText, PrefixRE, CheckStrings)) + return false; + auto OutBuffer = OutputBuf->getBuffer(); SM.AddNewSourceBuffer(std::move(OutputBuf), SMLoc()); return FC.CheckInput(SM, OutBuffer, CheckStrings);