[clang] a6bb7c2 - [CUDA] Fix test failing when using the new driver

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 6 18:16:01 PDT 2022


Author: Joseph Huber
Date: 2022-09-06T20:14:20-05:00
New Revision: a6bb7c22fc288686010076ac253a12b4b1cd2ee5

URL: https://github.com/llvm/llvm-project/commit/a6bb7c22fc288686010076ac253a12b4b1cd2ee5
DIFF: https://github.com/llvm/llvm-project/commit/a6bb7c22fc288686010076ac253a12b4b1cd2ee5.diff

LOG: [CUDA] Fix test failing when using the new driver

Summary:
Previously the new driver crashed when using `-fsyntax-only` which
required a work-around in one of the test files. This was not properly
updated when it was fixed for the new driver. This patch fixes the test
and also adjusts a missing boolean check.

Added: 
    

Modified: 
    clang/lib/Driver/Driver.cpp
    clang/test/Driver/cuda-bindings.cu

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 9517331ade26..ca8e0e5240e1 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -4391,7 +4391,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C,
   }) && isa<CompileJobAction>(HostAction);
   OffloadAction::HostDependence HDep(
       *HostAction, *C.getSingleOffloadToolChain<Action::OFK_Host>(),
-      /*BoundArch=*/nullptr, isa<CompileJobAction>(HostAction) ? DDep : DDeps);
+      /*BoundArch=*/nullptr, SingleDeviceOutput ? DDep : DDeps);
   return C.MakeAction<OffloadAction>(HDep, SingleDeviceOutput ? DDep : DDeps);
 }
 

diff  --git a/clang/test/Driver/cuda-bindings.cu b/clang/test/Driver/cuda-bindings.cu
index 3cc65b8cf98b..ce4b423064bc 100644
--- a/clang/test/Driver/cuda-bindings.cu
+++ b/clang/test/Driver/cuda-bindings.cu
@@ -102,8 +102,6 @@
 // NDSYN-NOT: inputs:
 // NDSYN: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing)
 // NDSYN-NEXT: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing)
-// ! FIXME: new driver erroneously attempts to run linker phase w/ no inputs.
-//          Remove these checks once the issue is solved.
 // NDSYN-NEXT: "nvptx64-nvidia-cuda" - "NVPTX::Linker", inputs: [(nothing), (nothing)], output: "{{.*}}"
 // NDSYN-NEXT: # "powerpc64le-ibm-linux-gnu" - "clang", inputs: [{{.*}}], output: (nothing)
 // NDSYN-NOT: inputs:


        


More information about the cfe-commits mailing list