r363985 - [test][Driver] Fix Clang :: Driver/cl-response-file.c

Rainer Orth via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 21 07:01:48 PDT 2019


Hi Douglas,

> Your change appears to have broken the one platform you didn't test, Windows. :)

sorry about that.  Unfortunately, I know next to nothing about Windows
and don't have access to any system to test.

That said...

> Script:
> --
> : 'RUN: at line 7'; printf
> '/IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Driver\Inputs\\cl-response-file\
> /DFOO=2' >
> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\tools\clang\test\Driver\Output\cl-response-file.c.tmp.rsp

... I should have looked at the autoconf manual first which has a whole
section on the can of worms that is echo and how to properly use printf
instead.

> Looking into this locally, the path contains "\t", so the response file that is generated looks like this:
>
> C:\src\git\merge\llvm\tools\clang\test\Driver>type cl-response-file.c.tmp.rsp
> /IC:\src\git\merge\llvm ools

The path not only contains \t, but \c as well, so the path is truncated
after " ools".

> Can you take a look to see if there is something that works for all platforms including Windows?

Judging from both the autoconf manual and my local testing, the
following should work properly:

// RUN: printf '%s\n' '/I%S\Inputs\\cl-response-file\ /DFOO=2' > %t.rsp

i.e. use printf '%s\n' to do the printing.  I should have done this in
the first place since otherwise the response file wasn't
newline-terminated.  Obviously that didn't matter on Solaris and Linux.

Once you've confirmed this works on Windows, I'll submit a proper
follow-up patch.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the cfe-commits mailing list