github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {darker}-->


:warning: Python code formatter, darker found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
darker --check --diff -r origin/main...HEAD clang/test/lit.cfg.py
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- lit.cfg.py  2026-08-27 11:29:58.000000 +0000
+++ lit.cfg.py  2026-08-27 11:31:31.317382 +0000
@@ -219,29 +219,34 @@
         if clang_repl_cmd.stdout.find(b"success") != -1:
             return True
 
     return False
 
+
 def have_host_clang_repl_hip():
-    clang_repl_exe = lit.util.which('clang-repl', config.clang_tools_dir)
+    clang_repl_exe = lit.util.which("clang-repl", config.clang_tools_dir)
 
     if not clang_repl_exe:
         return False
 
-    testcode = b'\n'.join([
-        b"#include <hip/hip_runtime.h>",
-        b"__global__ void test_func() {}",
-        b"test_func<<<1,1>>>();",
-        b"extern \"C\" int puts(const char *s);",
-        b"puts(hipGetLastError() ? \"failure\" : \"success\");",
-        b"%quit"
-    ])
+    testcode = b"\n".join(
+        [
+            b"#include <hip/hip_runtime.h>",
+            b"__global__ void test_func() {}",
+            b"test_func<<<1,1>>>();",
+            b'extern "C" int puts(const char *s);',
+            b'puts(hipGetLastError() ? "failure" : "success");',
+            b"%quit",
+        ]
+    )
     try:
-        clang_repl_cmd = subprocess.run([clang_repl_exe, '--hip'],
-                                        stdout=subprocess.PIPE,
-                                        stderr=subprocess.PIPE,
-                                        input=testcode)
+        clang_repl_cmd = subprocess.run(
+            [clang_repl_exe, "--hip"],
+            stdout=subprocess.PIPE,
+            stderr=subprocess.PIPE,
+            input=testcode,
+        )
     except OSError:
         return False
 
     if clang_repl_cmd.returncode == 0:
         if clang_repl_cmd.stdout.find(b"success") != -1:
@@ -262,11 +267,11 @@
 
     if have_host_clang_repl_cuda():
         config.available_features.add('host-supports-cuda')
 
     if have_host_clang_repl_hip():
-        config.available_features.add('host-supports-hip')
+        config.available_features.add("host-supports-hip")
     hosttriple = run_clang_repl("--host-jit-triple")
     config.substitutions.append(("%host-jit-triple", hosttriple.strip()))
 
     if have_host_out_of_process_jit_feature_support():
         config.available_features.add("host-supports-out-of-process-jit")

``````````

</details>


https://github.com/llvm/llvm-project/pull/217582
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to