[clang] [clang][Tooling] Fix assertion failure when processing CUDA files (PR #173762)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 12 15:54:27 PST 2026


================
@@ -85,6 +85,13 @@ TEST(runToolOnCode, CudaSyntaxOnly) {
        "-nocudainc"}));
 }
 
+TEST(runToolOnCode, CudaMultipleArchs) {
+  EXPECT_TRUE(runToolOnCodeWithArgs(
+      std::make_unique<TestAction>(std::make_unique<clang::ASTConsumer>()), "",
+      {"-fsyntax-only", "-x", "cuda", "--offload-arch=sm_70,sm_80",
+       "-nocudalib", "-nocudainc"}));
----------------
zeyi2 wrote:

Hi, sorry that didn't understand what you meant, could you elaborate?

I think I've covered both scenarios, you can see that `CudaSyntaxOnly` is one architecture (`sm_70`) and `CudaMultipleArchs` are for `sm_70,sm_80`.

Thanks in advance!

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


More information about the cfe-commits mailing list