[CUDA] Fix test failing when using the new driver
authorJoseph Huber <jhuber6@vols.utk.edu>
Wed, 7 Sep 2022 01:14:20 +0000 (20:14 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 7 Sep 2022 01:14:20 +0000 (20:14 -0500)
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
clang/test/Driver/cuda-bindings.cu

index 9517331..ca8e0e5 100644 (file)
@@ -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);
 }
 
index 3cc65b8..ce4b423 100644 (file)
 // 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: