]> granicus.if.org Git - clang/commitdiff
Driver: Fix bug in translating -O to clang, add clang-translation test
authorDaniel Dunbar <daniel@zuster.org>
Wed, 18 Mar 2009 23:39:35 +0000 (23:39 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 18 Mar 2009 23:39:35 +0000 (23:39 +0000)
case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67257 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/clang-translation.c [new file with mode: 0644]

index db9d3972f2a439fe7cc7adaa8f505a6c5002f712..4cb73dbda38dc66f282390f21a441e5081edff26 100644 (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);
diff --git a/test/Driver/clang-translation.c b/test/Driver/clang-translation.c
new file mode 100644 (file)
index 0000000..44bf220
--- /dev/null
@@ -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