Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -12177,6 +12177,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"); Index: test/Driver/openmp-offload.c =================================================================== --- test/Driver/openmp-offload.c +++ test/Driver/openmp-offload.c @@ -596,3 +596,12 @@ // CHK-PTXAS: ptxas{{.*}}" "-c" // CHK-PTXAS-NEXT: /bin/cp + +/// ########################################################################### + +/// Check that CLANG forwards the -v flag to PTXAS. +// RUN: %clang -### -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -save-temps -no-canonical-prefixes -v %s 2>&1 \ +// RUN: | FileCheck -check-prefix=CHK-VERBOSE %s + +// CHK-VERBOSE: ptxas{{.*}}" "-v" +// CHK-VERBOSE-NEXT: /bin/cp