[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


================
@@ -97,8 +109,16 @@ def getStdCheckLine(prefix, output, mc_mode):
     return o
 
 
-def getErrCheckLine(prefix, output, mc_mode):
-    return COMMENT[mc_mode] + " " + prefix + ": " + ":[[@LINE-1]]" + output + "\n"
+def getErrCheckLine(prefix, output, mc_mode, line_offset=1):
+    return (
+        COMMENT[mc_mode]
+        + " "
+        + prefix
+        + ": "
+        + ":[[@LINE-{}]]".format(line_offset)
----------------
kosarev wrote:

Aren't we allowed to use f-strings in these scripts? I see `update_any_test_checks.py` does use them:
```
                            f"{utc_name}: not found (used in {testname})",
```

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


More information about the llvm-commits mailing list