From: Hans Wennborg Date: Fri, 25 Apr 2014 16:24:19 +0000 (+0000) Subject: clang-cl: pass -debug flag to the linker when compiling with debug info X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b67bacf5c681998d875faaa0c3c47c8dea71fccb;p=clang clang-cl: pass -debug flag to the linker when compiling with debug info git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207233 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 0a45fa190a..924e040246 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -7435,6 +7435,10 @@ void visualstudio::Link::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-nologo"); + if (Args.hasArg(options::OPT_g_Group)) { + CmdArgs.push_back("-debug"); + } + bool DLL = Args.hasArg(options::OPT__SLASH_LD, options::OPT__SLASH_LDd); if (DLL) { diff --git a/test/Driver/cl-link.c b/test/Driver/cl-link.c index 24e0702c8a..309c27dab1 100644 --- a/test/Driver/cl-link.c +++ b/test/Driver/cl-link.c @@ -31,3 +31,7 @@ // ASAN-DLL: "-incremental:no" // ASAN-DLL: "{{.*}}clang_rt.asan_dll_thunk-i386.lib" // ASAN-DLL: "{{.*}}cl-link{{.*}}.obj" + +// RUN: %clang_cl /Zi /Tc%s -### 2>&1 | FileCheck --check-prefix=DEBUG %s +// DEBUG: link.exe +// DEBUG: "-debug"