]> granicus.if.org Git - clang/commitdiff
Driver: Add test for binding of precompile; exposed bug due to my
authorDaniel Dunbar <daniel@zuster.org>
Wed, 18 Mar 2009 02:00:31 +0000 (02:00 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 18 Mar 2009 02:00:31 +0000 (02:00 +0000)
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

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

index 5c843b004e1787a80cf3baa09e01bb81d12606b4..2538ed8384ff713d2c7ab3d9d1dd9f4f75226245 100644 (file)
@@ -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;
index 254de317e9ba3bfe510ec586603424be56a9f68a..73272be59d9f3c978269e5097402abd7959cdca9 100644 (file)
@@ -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 &&