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

2019-06-24 Thread Rainer Orth via cfe-commits
Hi Douglas,

> 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've now tested it myself successfully on amd64-pc-solaris2.11.  I'd
figured the \\c -> \c part out already, but had to leave before
understanding the %s problem.

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

That would be great, thanks a lot.

Rainer
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2019-06-21 Thread via cfe-commits
I see Reid has reverted your original fix so instead of directly submitting, I 
have put the patch up for review first at https://reviews.llvm.org/D63678.

Douglas Yung

-Original Message-
From: Rainer Orth  
Sent: Friday, June 21, 2019 14:46
To: Yung, Douglas 
Cc: cfe-commits@lists.llvm.org
Subject: Re: r363985 - [test][Driver] Fix Clang :: Driver/cl-response-file.c

Hi Douglas,

> 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've now tested it myself successfully on amd64-pc-solaris2.11.  I'd figured 
the \\c -> \c part out already, but had to leave before understanding the %s 
problem.

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

That would be great, thanks a lot.

Rainer
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2019-06-21 Thread via cfe-commits
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  
Sent: Friday, June 21, 2019 7:02
To: Yung, Douglas 
Cc: r...@gcc.gnu.org; cfe-commits@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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2019-06-21 Thread via cfe-commits
Hi Rainer,

I tried your patch and it still has problems. First, the "%s" was being 
replaced with the actual path by LIT, so I replaced that with "%%s" which then 
created the response file correctly, but now the response file contains this:

/IC:\src\git\dev\llvm\tools\clang\test\Driver\Inputs\\cl-response-file\ /DFOO=2

Which unfortunately gets interpreted by the compiler as:

"-I" 
"C:\\src\\git\\dev\\llvm\\tools\\clang\\test\\Driver\\Inputscl-response-file\\"
 "-D" "FOO=2"

Which doesn't match the CHECK line. Note the 4 backslashes. I think this could 
probably be fixed by just using a regex to match 1 or more backslashes?

Douglas Yung

-Original Message-
From: Rainer Orth  
Sent: Friday, June 21, 2019 7:02
To: Yung, Douglas 
Cc: r...@gcc.gnu.org; cfe-commits@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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2019-06-21 Thread Rainer Orth via cfe-commits
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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2019-06-21 Thread via cfe-commits
86)\\Windows Kits\\10\\include\\10.0.17763.0\\shared" 
"-internal-isystem" "C:\\Program Files (x86)\\Windows 
Kits\\10\\include\\10.0.17763.0\\um" "-internal-isystem" "C:\\Program Files 
(x86)\\Windows Kits\\10\\include\\10.0.17763.0\\winrt" "-internal-isystem" 
"C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17763.0\\cppwinrt" 
"-fdebug-compilation-dir" 
"C:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.obj\\tools\\clang\\test\\Driver"
 "-ferror-limit" "19" "-fmessage-length" "0" "-fno-use-cxa-atexit" 
"-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.16.27026" 
"-fdelayed-template-parsing" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" 
"-faddrsig" "-o" "cl-response-file.obj" "-x" "c" 
"C:\\ps4-buildslave2\\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\\llvm.src\\tools\\clang\\test\\Driver\\cl-response-file.c"
























    
                        




   ^


error: command failed with exit status: 1


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

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

Douglas Yung

-Original Message-
From: cfe-commits  On Behalf Of Rainer Orth 
via cfe-commits
Sent: Thursday, June 20, 2019 14:33
To: cfe-commits@lists.llvm.org
Subject: r363985 - [test][Driver] Fix Clang :: Driver/cl-response-file.c

Author: ro
Date: Thu Jun 20 14:33:09 2019
New Revision: 363985

URL: http://llvm.org/viewvc/llvm-project?rev=363985=rev
Log:
[test][Driver] Fix Clang :: Driver/cl-response-file.c

Clang :: Driver/cl-response-file.c currently FAILs on Solaris:

  Command Output (stderr):
  --
  /vol/llvm/src/clang/dist/test/Driver/cl-response-file.c:10:11: error: CHECK: 
expected string not found in input
  // CHECK: "-I" "{{.*}}\\Inputs\\cl-response-file\\" "-D" "FOO=2"
^

Looking at the generated response file reveals that this is no surprise:

  /I/vol/llvm/src/clang/dist/test/Driver\Inputs

with no newline at the end.  The echo command used to create it boils down to

  echo 'a\cb'

However, one cannot expect \c to be emitted literally: e.g. bash's builtin echo 
has

  \csuppress further output

I

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

2019-06-20 Thread Rainer Orth via cfe-commits
Author: ro
Date: Thu Jun 20 14:33:09 2019
New Revision: 363985

URL: http://llvm.org/viewvc/llvm-project?rev=363985=rev
Log:
[test][Driver] Fix Clang :: Driver/cl-response-file.c

Clang :: Driver/cl-response-file.c currently FAILs on Solaris:

  Command Output (stderr):
  --
  /vol/llvm/src/clang/dist/test/Driver/cl-response-file.c:10:11: error: CHECK: 
expected string not found in input
  // CHECK: "-I" "{{.*}}\\Inputs\\cl-response-file\\" "-D" "FOO=2"
^

Looking at the generated response file reveals that this is no surprise:

  /I/vol/llvm/src/clang/dist/test/Driver\Inputs

with no newline at the end.  The echo command used to create it boils down to

  echo 'a\cb'

However, one cannot expect \c to be emitted literally: e.g. bash's builtin
echo has

  \csuppress further output

I've tried various combinations of builtin echo, /usr/bin/echo, GNU echo if
different, the same for printf, and the backslash unescaped and quoted
(a\cb and a\\cb).  The only combination that worked reliably on Solaris,
Linux, and macOS was

  printf 'a\\cb'

so this is what this patch uses.  Tested on amd64-pc-solaris2.11 and
x86_64-pc-linux-gnu.

Differential Revision: https://reviews.llvm.org/D63600

Modified:
cfe/trunk/test/Driver/cl-response-file.c

Modified: cfe/trunk/test/Driver/cl-response-file.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/cl-response-file.c?rev=363985=363984=363985=diff
==
--- cfe/trunk/test/Driver/cl-response-file.c (original)
+++ cfe/trunk/test/Driver/cl-response-file.c Thu Jun 20 14:33:09 2019
@@ -4,7 +4,7 @@
 
 
 
-// RUN: echo '/I%S\Inputs\cl-response-file\ /DFOO=2' > %t.rsp
+// RUN: printf '/I%S\Inputs\\cl-response-file\ /DFOO=2' > %t.rsp
 // RUN: %clang_cl /c -### @%t.rsp -- %s 2>&1 | FileCheck %s
 
 // CHECK: "-I" "{{.*}}\\Inputs\\cl-response-file\\" "-D" "FOO=2"


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits