[PATCH] D29644: [OpenMP] Pass -v to PTXAS if it was passed to the driver.

Gheorghe-Teodor Bercea via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 31 09:51:08 PDT 2017


gtbercea updated this revision to Diff 93676.
gtbercea added a comment.

Move test.


Repository:
  rL LLVM

https://reviews.llvm.org/D29644

Files:
  lib/Driver/ToolChains/Cuda.cpp
  test/Driver/cuda-external-tools.cu


Index: test/Driver/cuda-external-tools.cu
===================================================================
--- test/Driver/cuda-external-tools.cu
+++ test/Driver/cuda-external-tools.cu
@@ -65,6 +65,10 @@
 // RUN: %clang -### -target x86_32-apple-macosx -c %s 2>&1 \
 // RUN: | FileCheck -check-prefix ARCH32 -check-prefix SM20 %s
 
+// Check that CLANG forwards the -v flag to PTXAS.
+// RUN:   %clang -### -save-temps -no-canonical-prefixes -v %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHK-PTXAS-VERBOSE %s
+
 // Match clang job that produces PTX assembly.
 // CHECK: "-cc1" "-triple" "nvptx64-nvidia-cuda"
 // SM20: "-target-cpu" "sm_20"
@@ -110,3 +114,5 @@
 // Match the clang job for host compilation.
 // CHECK: "-cc1" "-triple" "x86_64--linux-gnu"
 // CHECK-SAME: "-fcuda-include-gpubinary" "[[FATBINARY]]"
+
+// CHK-PTXAS-VERBOSE: ptxas{{.*}}" "-v"
Index: lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- lib/Driver/ToolChains/Cuda.cpp
+++ lib/Driver/ToolChains/Cuda.cpp
@@ -262,6 +262,10 @@
     CmdArgs.push_back("-O0");
   }
 
+  // Pass -v to ptxas if it was passed to the driver.
+  if (Args.hasArg(options::OPT_v))
+    CmdArgs.push_back("-v");
+
   CmdArgs.push_back("--gpu-name");
   CmdArgs.push_back(Args.MakeArgString(CudaArchToString(gpu_arch)));
   CmdArgs.push_back("--output-file");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29644.93676.patch
Type: text/x-patch
Size: 1367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170331/28da3905/attachment.bin>


More information about the cfe-commits mailing list