<br><br><div class="gmail_quote">On Wed, May 23, 2012 at 5:27 PM, Manuel Klimek <span dir="ltr"><<a href="mailto:klimek@google.com" target="_blank">klimek@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div><div class="h5">On Wed, May 23, 2012 at 1:58 PM, NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com" target="_blank">geek4civic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

2012/5/23 Michael Spencer <<a href="mailto:bigcheesegs@gmail.com" target="_blank">bigcheesegs@gmail.com</a>>:<br>
<div>> On Tue, May 22, 2012 at 5:50 PM, NAKAMURA Takumi <<a href="mailto:geek4civic@gmail.com" target="_blank">geek4civic@gmail.com</a>> wrote:<br>
>> They could pass also on msvc if they were -fms-compatibility tolerant.<br>
>><br>
>> Manuel, I would be happier if you could tweak tests with -target i686-win32.<br>
>><br>
>> ---<br>
>> clang/lib/Tooling/CompilationDatabase.cpp | 8 ++++++--<br>
>> clang/lib/Tooling/Tooling.cpp | 8 ++++++--<br>
>> clang/test/Tooling/clang-check-builtin-headers.cpp | 2 +-<br>
>> clang/test/Tooling/clang-check-chdir.cpp | 2 +-<br>
>> clang/test/Tooling/clang-check-pwd.cpp | 2 +-<br>
>> clang/test/Tooling/clang-check.cpp | 2 +-<br>
>> llvm/lib/Support/PathV2.cpp | 3 +++<br>
>> 7 files changed, 19 insertions(+), 8 deletions(-)<br>
><br>
> +  // FIXME: Does Win32 accept '.\\'?<br>
><br>
> Yes it does. Well, cmd.exe does.<br>
<br>
</div>I would like to say here, "Could Win32's '.\\' be accepted here?"<br>
I have to add later. I think it would be critical issue.<br>
<div><div><br>
> diff --git a/clang/test/Tooling/clang-check-builtin-headers.cpp<br>
> b/clang/test/Tooling/clang-check-builtin-headers.cpp<br>
> index 4324dec..b640d05 100644<br>
> --- a/clang/test/Tooling/clang-check-builtin-headers.cpp<br>
> +++ b/clang/test/Tooling/clang-check-builtin-headers.cpp<br>
> @@ -1,7 +1,7 @@<br>
>  // RUN: rm -rf %t<br>
>  // RUN: mkdir %t<br>
>  // Add a path that doesn't exist as argv[0] for the compile command line:<br>
> -// RUN: echo '[{"directory":".","command":"/random/tool -c<br>
> %t/test.cpp","file":"%t/test.cpp"}]' > %t/compile_commands.json<br>
> +// RUN: echo '[{"directory":".","command":"/random/tool -c<br>
> %t/test.cpp","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' ><br>
> %t/compile_commands.json<br>
>  // RUN: cp "%s" "%t/test.cpp"<br>
>  // RUN: clang-check "%t" "%t/test.cpp" 2>&1|FileCheck %s<br>
>  // FIXME: Make the above easier.<br>
> diff --git a/clang/test/Tooling/clang-check-chdir.cpp<br>
> b/clang/test/Tooling/clang-check-chdir.cpp<br>
> index 5d02c95..7c465f3 100644<br>
> --- a/clang/test/Tooling/clang-check-chdir.cpp<br>
> +++ b/clang/test/Tooling/clang-check-chdir.cpp<br>
> @@ -2,7 +2,7 @@<br>
>  // compilation database.<br>
>  // RUN: rm -rf %t<br>
>  // RUN: mkdir %t<br>
> -// RUN: echo "[{\"directory\":\"%t\",\"command\":\"clang -c test.cpp<br>
> -I.\",\"file\":\"%t/test.cpp\"}]" > %t/compile_commands.json<br>
> +// RUN: echo "[{\"directory\":\"%t\",\"command\":\"clang -c test.cpp<br>
> -I.\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\//g' ><br>
> %t/compile_commands.json<br>
>  // RUN: cp "%s" "%t/test.cpp"<br>
>  // RUN: touch "%t/clang-check-test.h"<br>
>  // RUN: clang-check "%t" "%t/test.cpp" 2>&1|FileCheck %s<br>
> diff --git a/clang/test/Tooling/clang-check-pwd.cpp<br>
> b/clang/test/Tooling/clang-check-pwd.cpp<br>
> index 96417df..40336cb 100644<br>
> --- a/clang/test/Tooling/clang-check-pwd.cpp<br>
> +++ b/clang/test/Tooling/clang-check-pwd.cpp<br>
> @@ -1,6 +1,6 @@<br>
>  // RUN: rm -rf %t<br>
>  // RUN: mkdir %t<br>
> -// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c<br>
> %t/test.cpp\",\"file\":\"%t/test.cpp\"}]" > %t/compile_commands.json<br>
> +// RUN: echo "[{\"directory\":\".\",\"command\":\"clang++ -c<br>
> %t/test.cpp\",\"file\":\"%t/test.cpp\"}]" | sed -e 's/\\/\\\\/g' ><br>
> %t/compile_commands.json<br>
>  // RUN: cp "%s" "%t/test.cpp"<br>
>  // RUN: PWD="%t" clang-check "%t" "test.cpp" 2>&1|FileCheck %s<br>
>  // FIXME: Make the above easier.<br>
> diff --git a/clang/test/Tooling/clang-check.cpp<br>
> b/clang/test/Tooling/clang-check.cpp<br>
> index d197078..d37d14d 100644<br>
> --- a/clang/test/Tooling/clang-check.cpp<br>
> +++ b/clang/test/Tooling/clang-check.cpp<br>
> @@ -1,6 +1,6 @@<br>
>  // RUN: rm -rf %t<br>
>  // RUN: mkdir %t<br>
> -// RUN: echo '[{"directory":".","command":"clang++ -c<br>
> %t/test.cpp","file":"%t/test.cpp"}]' > %t/compile_commands.json<br>
> +// RUN: echo '[{"directory":".","command":"clang++ -c<br>
> %t/test.cpp","file":"%t/test.cpp"}]' | sed -e 's/\\/\//g' ><br>
> %t/compile_commands.json<br>
>  // RUN: cp "%s" "%t/test.cpp"<br>
>  // RUN: clang-check "%t" "%t/test.cpp" 2>&1|FileCheck %s<br>
>  // FIXME: Make the above easier.<br>
><br>
> For all these tests can we please not use sed? I'd like to get rid of<br>
> all dependencies on these tools so Windows can test without GNUWin32.<br>
<br>
</div></div>It would be happier if we would get rid of external tools.<br>
Then, shall we enhance Lit to expand %X with modifier to be escaped for JSON?<br>
<br>
Not only sed(1), I can see but also echo(1), cat(1) and cp(1) :p<br>
Would you like to prune them anyways?</blockquote><div><br></div></div></div><div>I'm still not sure what our strategy for path handling on windows is...</div><div>There are multiple strategies I've seen work. Simple strategies are:</div>

<div>1. accept any path format, convert all paths to an internal representation when they enter the application, output according to platform; this might be combined with having a real Path abstraction that programmers can use instead of having strings for paths</div>
</div></blockquote><div><br>Note: Windows accept paths using `/`, it just happens to default to \ for printing them for some reasons. Therefore if this output issue is Windows specific, then we could just accept both styles and always output with `/` as a path separator.<br>
 </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote">
<div>2. accept only platform specific path format and use paths verbatim; double-special case path handling everywhere</div><div><br></div><div>Can somebody enlighten me what clang's strategy is?</div><div><br></div>
<div>
Cheers,</div><div>/Manuel</div><div><br></div></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br>