From a6bb7c22fc288686010076ac253a12b4b1cd2ee5 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Tue, 6 Sep 2022 20:14:20 -0500 Subject: [PATCH] [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. --- clang/lib/Driver/Driver.cpp | 2 +- clang/test/Driver/cuda-bindings.cu | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 9517331..ca8e0e5 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -4391,7 +4391,7 @@ Action *Driver::BuildOffloadingActions(Compilation &C, }) && isa(HostAction); OffloadAction::HostDependence HDep( *HostAction, *C.getSingleOffloadToolChain(), - /*BoundArch=*/nullptr, isa(HostAction) ? DDep : DDeps); + /*BoundArch=*/nullptr, SingleDeviceOutput ? DDep : DDeps); return C.MakeAction(HDep, SingleDeviceOutput ? DDep : DDeps); } diff --git a/clang/test/Driver/cuda-bindings.cu b/clang/test/Driver/cuda-bindings.cu index 3cc65b8..ce4b423 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: -- 2.7.4