Don't produce debug info when given -g. Fixes PR6529.

llvm-svn: 97897
This commit is contained in:
Rafael Espindola 2010-03-07 04:46:18 +00:00
parent 5cbff48b01
commit 08a692aba4
2 changed files with 8 additions and 1 deletions

View File

@ -929,7 +929,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
// Special case debug options to only pass -g to clang. This is // Special case debug options to only pass -g to clang. This is
// wrong. // wrong.
if (Args.hasArg(options::OPT_g_Group)) Args.ClaimAllArgs(options::OPT_g_Group);
Arg *Garg = Args.getLastArg(options::OPT_g_Group);
if (Garg && Garg != Args.getLastArg(options::OPT_g0))
CmdArgs.push_back("-g"); CmdArgs.push_back("-g");
Args.AddLastArg(CmdArgs, options::OPT_nostdinc); Args.AddLastArg(CmdArgs, options::OPT_nostdinc);

View File

@ -0,0 +1,5 @@
// RUN: %clang -S -v -o %t %s 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g 2>&1 | grep -w -- -g
// RUN: %clang -S -v -o %t %s -g0 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g -g0 2>&1 | not grep -w -- -g
// RUN: %clang -S -v -o %t %s -g0 -g 2>&1 | grep -w -- -g