From d46f0acef540c3030f7b40525fb732fc343dcfad Mon Sep 17 00:00:00 2001 From: Daniel Dunbar <daniel@zuster.org> Date: Wed, 18 Mar 2009 00:12:31 +0000 Subject: [PATCH] Driver: Add test case for -ccc-clang-archs (which, it turns out, was inverted). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67135 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/ToolChain.cpp | 4 ++-- test/Driver/bindings.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index ea2528bfff..11dc9aad8f 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -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; diff --git a/test/Driver/bindings.c b/test/Driver/bindings.c index 0f93af10cd..254de317e9 100644 --- a/test/Driver/bindings.c +++ b/test/Driver/bindings.c @@ -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 -- 2.40.0