]> granicus.if.org Git - llvm/commitdiff
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353081 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/CodeGen/GlobalISel/GISelMITest.h

index 32feb584f43829c75cf0c854214b0cedc225f9a8..5ac81e227cdc971708a53da827cf59368feb4330 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);