[Lldb-commits] [PATCH] D18044: Fix a couple of cornercases in FileSpec + tests

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Wed Mar 16 07:37:17 PDT 2016


Yea, because of the fact that we must support both syntaxes on both
platforms, LLVM library is out.

The whole motivation for introducing the path syntax is so that windows
paths behave as if on Windows even if on linux
On Wed, Mar 16, 2016 at 6:19 AM Pavel Labath <labath at google.com> wrote:

> labath added inline comments.
>
> ================
> Comment at: lldb/trunk/unittests/Host/FileSpecTest.cpp:25
> @@ +24,3 @@
> +    EXPECT_STREQ("F:\\bar", fs_windows.GetCString());
> +    EXPECT_STREQ("F:", fs_windows.GetDirectory().GetCString());
> +    EXPECT_STREQ("bar", fs_windows.GetFilename().GetCString());
> ----------------
> So this returns `F:` on linux and `F:\` on Windows. This happens because
> `llvm::sys::path::parent_path` does not recognize `F:` as a "root
> directory" on linux, and therefore treats it differently. I don't know
> which behavior is more "correct" (probably the windows one), but I think
> that this should be consistent, regardless of the platform the test is run
> on (my original motivation for writing this was the fact that i was getting
> wonky paths while attempting to write other unit tests). Unfortunately, I
> think that means getting rid of llvm's path processing library...
>
> What do you make of that?
>
> (I am going on holiday, so I cannot to anything about this now. if you
> want to have a clean test run in the mean time, I am fine commenting these
> checks out or something...)
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D18044
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160316/556acd2e/attachment-0001.html>


More information about the lldb-commits mailing list