From: Daniel Dunbar Date: Wed, 18 Mar 2009 02:00:31 +0000 (+0000) Subject: Driver: Add test for binding of precompile; exposed bug due to my X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5796bf4913832bd1165c3ff5e04838d150de1c4c;p=clang Driver: Add test for binding of precompile; exposed bug due to my flawed idea that llvm::sys::Path::getBasename was a version of basename(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67153 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 5c843b004e..2538ed8384 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -790,7 +790,7 @@ const char *Driver::GetNamedOutputPath(Compilation &C, } llvm::sys::Path BasePath(BaseInput); - std::string BaseName(BasePath.getBasename()); + std::string BaseName(BasePath.getLast()); // Determine what the derived output name should be. const char *NamedOutput; diff --git a/test/Driver/bindings.c b/test/Driver/bindings.c index 254de317e9..73272be59d 100644 --- a/test/Driver/bindings.c +++ b/test/Driver/bindings.c @@ -21,6 +21,9 @@ // RUN: grep 'bind - "gcc::Assemble", inputs: \[(pipe)\], output: "/tmp/foo.o"' %t && // RUN: grep 'bind - "gcc::Link", inputs: \["/tmp/foo.o"\], output: "a.out"' %t && +// RUN: clang-driver -ccc-print-bindings -ccc-no-clang -x c-header %s &> %t && +// RUN: grep 'bind - "gcc::Precompile", inputs: \[".*bindings.c"\], output: ".*/bindings.c.gch' %t && + // Clang control options // RUN: clang-driver -ccc-print-bindings -fsyntax-only %s &> %t &&