GlobalISel: Fix CheckMachineFunction passing if ReadCheckFile files
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 4 Feb 2019 19:53:22 +0000 (19:53 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 4 Feb 2019 19:53:22 +0000 (19:53 +0000)
This could be tested, but the FileCheck library spams the error
message to the console.

llvm-svn: 353081

llvm/unittests/CodeGen/GlobalISel/GISelMITest.h

index 32feb58..5ac81e2 100644 (file)
@@ -195,7 +195,9 @@ static inline bool CheckMachineFunction(const MachineFunction &MF,
                         SMLoc());
   Regex PrefixRE = FC.buildCheckPrefixRegex();
   std::vector<FileCheckString> 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);