[PATCH] D122251: [lit] Use sharding for GoogleTest format

Yuanfang Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 24 09:13:58 PDT 2022


ychen added inline comments.


================
Comment at: llvm/utils/lit/lit/main.py:143-144
+                idxs.append(idx)
+        for i in range(len(idxs)):
+            del tests[idxs[i]-i]
+
----------------
jhenderson wrote:
> Doesn't this invalidate the indexes after the first one? If we need to delete items 2 and 4 in the list, after deleting item 2, item 4 will be at index 3 now.
The `-i` makes the index correct. To delete items 2 and 4 in the list, the `idxs` is `[2,4]`. The `del` statement ends up being `del tests[2-0]` and `del tests[4-1]`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122251



More information about the llvm-commits mailing list