Skip to content

Commit fb4ad18

Browse files
committed
fix cuda tests
1 parent 44b7065 commit fb4ad18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/utils/generate_ast_matcher_doc_tests.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ def can_code_compile(
446446
code_file_name = "code.cpp"
447447
if compile_commands and compile_commands.lang_spec.cxx == "":
448448
code_file_name = "code.c"
449+
if compile_commands and "cuda" in compile_commands.lang_spec.raw:
450+
code_file_name = "code.cu"
449451

450452
(tmp_path / code_file_name).write_text(code)
451453

@@ -601,7 +603,7 @@ def build_test_case(self):
601603
const StringRef Code = R"cpp(\n{self.code})cpp";\n"""
602604

603605
if has_cuda:
604-
res += """
606+
res += f"""
605607
const StringRef CudaHeader = R"cuda({cuda_header}
606608
)cuda";
607609
"""

0 commit comments

Comments
 (0)