[llvm] [AMDGPU][test]added remove duplicate options for update_mc_test_check script (PR #111769)

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 03:01:58 PDT 2024


================
@@ -118,6 +119,19 @@ def main():
         default=None,
         help="Set a default -march for when neither triple nor arch are found in a RUN line",
     )
+    parser.add_argument(
+        "--remove-duplicate",
+        action="store_true",
+        default=False,
+        help="remove duplicated test line if found",
+    )
+    parser.add_argument(
+        "--sort",
+        action="store_true",
+        default=False,
+        help="sort testline in alphabetic order (keep run-lines on top), this option could be dangerous as it"
+        "could change the order of lines that are not expected",
----------------
kosarev wrote:

> the `//comment 2` can be a comment for the whole section bellow,

If the script reported these duplicate cases (established by considering them with all comment lines stripped), then I think it shouldn't be a problem. The user will see the warning/error, fix the test case and run the script again.

I'd expect the script to play safe and only remove test cases when there's no doubt that they are duplicates, that is, when they are absolutely identical (which I guess should be the case for most of duplicates).

https://github.com/llvm/llvm-project/pull/111769


More information about the llvm-commits mailing list