[PATCH] D130282: [llvm][FileCheck] Fix unit tests failures with EXPENSIVE_CHECKS

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 02:07:49 PDT 2022


DavidSpickett updated this revision to Diff 446746.
DavidSpickett added a comment.

Always do the check.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130282/new/

https://reviews.llvm.org/D130282

Files:
  llvm/lib/FileCheck/FileCheck.cpp


Index: llvm/lib/FileCheck/FileCheck.cpp
===================================================================
--- llvm/lib/FileCheck/FileCheck.cpp
+++ llvm/lib/FileCheck/FileCheck.cpp
@@ -1424,6 +1424,8 @@
   // Sort variable captures by the order in which they matched the input.
   // Ranges shouldn't be overlapping, so we can just compare the start.
   llvm::sort(VarCaptures, [](const VarCapture &A, const VarCapture &B) {
+    if (&A == &B)
+      return false;
     assert(A.Range.Start != B.Range.Start &&
            "unexpected overlapping variable captures");
     return A.Range.Start.getPointer() < B.Range.Start.getPointer();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130282.446746.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220722/9389d35f/attachment.bin>


More information about the llvm-commits mailing list