]> granicus.if.org Git - clang/commitdiff
Driver: Add test case for -ccc-clang-archs (which, it turns out, was
authorDaniel Dunbar <daniel@zuster.org>
Wed, 18 Mar 2009 00:12:31 +0000 (00:12 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 18 Mar 2009 00:12:31 +0000 (00:12 +0000)
inverted).

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

lib/Driver/ToolChain.cpp
test/Driver/bindings.c

index ea2528bfffc197b1156e521666bf11f0322dce37..11dc9aad8fbcd488c71a5f02f977c596a0fcd1ef 100644 (file)
@@ -55,8 +55,8 @@ bool ToolChain::ShouldUseClangCompiler(const Compilation &C,
 
   // Finally, don't use clang if this isn't one of the user specified
   // archs to build.
-  if (!Host.getDriver().CCCClangArchs.empty() && 
-      Host.getDriver().CCCClangArchs.count(getArchName()))
+  if (!Host.getDriver().CCCClangArchs.empty() &&
+      !Host.getDriver().CCCClangArchs.count(getArchName()))
     return false;
 
   return true;
index 0f93af10cdc22e01335ce15dde0bc14e2c51263e..254de317e9ba3bfe510ec586603424be56a9f68a 100644 (file)
@@ -32,5 +32,9 @@
 // RUN: clang-driver -ccc-print-bindings -ccc-no-clang-cpp -fsyntax-only -no-integrated-cpp -x c++ %s &> %t &&
 // RUN: grep 'bind - "gcc::Preprocess", inputs: \[".*bindings.c"\], output: "/tmp/foo.ii"' %t &&
 // RUN: grep 'bind - "clang", inputs: \["/tmp/foo.ii"\], output: (nothing)' %t &&
+// RUN: clang-driver -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs i386 %s -S -arch ppc &> %t &&
+// RUN: grep 'bind - "gcc::Compile", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
+// RUN: clang-driver -ccc-host-triple i386-apple-darwin9 -ccc-print-bindings -ccc-clang-archs ppc %s -S -arch ppc &> %t &&
+// RUN: grep 'bind - "clang", inputs: \[".*bindings.c"\], output: "bindings.s"' %t &&
 
 // RUN: true