Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1632,7 +1632,8 @@ def nobuiltininc : Flag<["-"], "nobuiltininc">, Flags<[CC1Option]>, HelpText<"Disable builtin #include directories">; def nocudainc : Flag<["-"], "nocudainc">; -def nocudalib : Flag<["-"], "nocudalib">; +def nocudalibdevice : Flag<["-"], "nocudalibdevice">, + HelpText<"Don't link in the CUDA libdevice bitcode (libdevice.compute_xx.yy.bc)">; def nodefaultlibs : Flag<["-"], "nodefaultlibs">; def nofixprebinding : Flag<["-"], "nofixprebinding">; def nolibc : Flag<["-"], "nolibc">; Index: lib/Driver/ToolChains.cpp =================================================================== --- lib/Driver/ToolChains.cpp +++ lib/Driver/ToolChains.cpp @@ -4200,7 +4200,7 @@ Linux::addClangTargetOptions(DriverArgs, CC1Args); CC1Args.push_back("-fcuda-is-device"); - if (DriverArgs.hasArg(options::OPT_nocudalib)) + if (DriverArgs.hasArg(options::OPT_nocudalibdevice)) return; std::string LibDeviceFile = CudaInstallation.getLibDeviceFile( Index: test/Driver/cuda-detect.cu =================================================================== --- test/Driver/cuda-detect.cu +++ test/Driver/cuda-detect.cu @@ -34,9 +34,9 @@ // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_30 \ // RUN: --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \ // RUN: | FileCheck %s -check-prefix COMMON -check-prefix NOLIBDEVICE -// .. or if we explicitly passed -nocudalib +// .. or if we explicitly passed -nocudalibdevice // RUN: %clang -### -v --target=i386-unknown-linux --cuda-gpu-arch=sm_35 \ -// RUN: -nocudalib --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \ +// RUN: -nocudalibdevice --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \ // RUN: | FileCheck %s -check-prefix COMMON -check-prefix NOLIBDEVICE // Verify that we don't add include paths, link with libdevice or // -include __clang_cuda_runtime_wrapper.h without valid CUDA installation.