Driver: Fix bug in translating -O to clang, add clang-translation test

case.

llvm-svn: 67257
This commit is contained in:
Daniel Dunbar 2009-03-18 23:39:35 +00:00
parent 483693941c
commit 7ef5ed6c16
2 changed files with 12 additions and 1 deletions

View File

@ -290,7 +290,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
if (A->getValue(Args)[0] == '\0')
CmdArgs.push_back("-O1");
else
CmdArgs.push_back(A->getValue(Args));
A->render(Args, CmdArgs);
}
Args.AddAllArgs(CmdArgs, options::OPT_clang_W_Group, options::OPT_pedantic_Group);

View File

@ -0,0 +1,11 @@
// RUN: clang-driver -ccc-host-triple i386-unknown-unknown -### -S -Os %s -o %t.s &> %t.log
// RUN: grep '"-S"' %t.log &&
// RUN: grep '"-disable-free"' %t.log &&
// RUN: grep '"--relocation-model" "static"' %t.log &&
// RUN: grep '"--disable-fp-elim"' %t.log &&
// RUN: grep '"--unwind-tables=0"' %t.log &&
// RUN: grep '"--fmath-errno=1"' %t.log &&
// RUN: grep '"-Os"' %t.log &&
// RUN: grep '"-arch" "i386"' %t.log &&
// RUN: grep '"-o" .*clang-translation\.c\.out\.tmp\.s' %t.log &&
// RUN: true