[llvm] [AMDGPU][test] fix the error case in update_mc_test_check script (PR #112731)

Ivan Kosarev via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 04:06:28 PDT 2024


================
@@ -151,11 +171,16 @@ def main():
             assert len(commands) >= 2
             mc_cmd = " | ".join(commands[:-1])
             filecheck_cmd = commands[-1]
-            mc_tool = mc_cmd.split(" ")[0]
 
             # special handling for negating exit status
-            if mc_tool == "not":
-                mc_tool = mc_tool + " " + mc_cmd.split(" ")[1]
+            prefix_not = ""
+            mc_cmd_args = mc_cmd.split(" ")
----------------
kosarev wrote:

I think it should be `split()` -- without arguments. With " " it wouldn't find 'not' if there are multiple spaces.

```
>>> 'a  b'.split(' ')
['a', '', 'b']
>>> 'a  b'.split()
['a', 'b']
```

But maybe we can just use a regexpr here?

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


More information about the llvm-commits mailing list