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

via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 21 11:50:52 PDT 2019


Hi Rainer,

I figured it out. Because you are using printf, you no longer need the '\\c'. If I use the following RUN line, the test passes on both Windows/linux (I don't have solaris to test unfortunately):

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

I can submit this patch for you if you would like.

Douglas Yung

-----Original Message-----
From: Rainer Orth <ro at CeBiTec.Uni-Bielefeld.DE> 
Sent: Friday, June 21, 2019 7:02
To: Yung, Douglas <douglas.yung at sony.com>
Cc: ro at gcc.gnu.org; cfe-commits at lists.llvm.org
Subject: Re: r363985 - [test][Driver] Fix Clang :: Driver/cl-response-file.c

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\ll
> vm.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