]> granicus.if.org Git - clang/commitdiff
Driver: Unbreak ArgList::hasFlag.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 30 Mar 2009 18:13:26 +0000 (18:13 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 30 Mar 2009 18:13:26 +0000 (18:13 +0000)
 - <rdar://problem/6726511> [driver] clang does not have -msoft-float
   hooked up.

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

lib/Driver/ArgList.cpp
test/Driver/flags.c [new file with mode: 0644]

index 2e526ab5d54532dd371ea70d23680f4fb0b92f3f..6d19f1acc59f7a5e4159c010c109ecd909ee647e 100644 (file)
@@ -51,7 +51,7 @@ Arg *ArgList::getLastArg(options::ID Id0, options::ID Id1, bool Claim) const {
 
 bool ArgList::hasFlag(options::ID Pos, options::ID Neg, bool Default) const {
   Arg *PosA = getLastArg(Pos);
-  Arg *NegA = getLastArg(Pos);
+  Arg *NegA = getLastArg(Neg);
   if (PosA && NegA)
     return NegA->getIndex() < PosA->getIndex();
   if (PosA) return true;
diff --git a/test/Driver/flags.c b/test/Driver/flags.c
new file mode 100644 (file)
index 0000000..53f3995
--- /dev/null
@@ -0,0 +1,9 @@
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float %s 2> %t.log &&
+// RUN: grep '"--soft-float"' %t.log &&
+
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -msoft-float -mno-soft-float %s 2> %t.log &&
+// RUN: grep '"--soft-float"' %t.log | count 0 &&
+
+// RUN: clang -ccc-host-triple i386-apple-darwin9 -### -S -mno-soft-float %s -msoft-float 2> %t.log &&
+// RUN: grep '"--soft-float"' %t.log
+