r342668 - Add testcases for r342667.

Jorge Gorbe Moya via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 20 15:54:30 PDT 2018


Filed https://bugs.llvm.org/show_bug.cgi?id=39029 for the incorrect
behavior when including a path with a leading slash on Windows.

On Thu, Sep 20, 2018 at 3:35 PM Eric Christopher <echristo at gmail.com> wrote:

> Thank you!
>
> On Thu, Sep 20, 2018, 3:34 PM Zachary Turner <zturner at google.com> wrote:
>
>> Test removed in r342693.
>>
>> On Thu, Sep 20, 2018 at 3:30 PM Jorge Gorbe Moya <jgorbe at google.com>
>> wrote:
>>
>>> Zach and I were able to find the cause.
>>>
>>> Clang on Windows manages to find "file.h" when you #include "/file.h"
>>> and that makes the expected diagnostic not appear. MSVC inteprets an
>>> #include with a leading slash as an absolute path so I think we have
>>> accidentally hit a different bug in Clang :)
>>>
>>> One option to fix the test would be replacing the slash with another
>>> random non-alphanumeric character that can't be interpreted as a directory
>>> separator, but at that point I think we can just delete the failing test
>>> and rely on the existing include-likely-typo.c that tests with both leading
>>> and trailing non-alphanumeric characters.
>>>
>>> The other test in r342668 works because it includes a file that doesn't
>>> exist even if you interpret the path as relative so it should be OK to keep
>>> while the bug is found.
>>>
>>> I'll go find a bug about the behavior on windows. Thanks!
>>>
>>> Jorge
>>>
>>> On Thu, Sep 20, 2018 at 2:51 PM Eric Christopher <echristo at gmail.com>
>>> wrote:
>>>
>>>> FWIW we're trying to reproduce here real fast and then will revert or
>>>> fix real fast.
>>>>
>>>> Thanks!
>>>>
>>>> -eric
>>>>
>>>> On Thu, Sep 20, 2018 at 2:46 PM Eric Christopher <echristo at gmail.com>
>>>> wrote:
>>>>
>>>>> Adding Jorge...
>>>>>
>>>>> On Thu, Sep 20, 2018 at 2:36 PM <douglas.yung at sony.com> wrote:
>>>>>
>>>>>> Hi Eric,
>>>>>>
>>>>>> The test that you added in this commit is failing on the PS4 Windows
>>>>>> bot. Can you please take a look?
>>>>>>
>>>>>>
>>>>>> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20052
>>>>>>
>>>>>> FAIL: Clang :: Preprocessor/include-leading-nonalpha-suggest.c (10765
>>>>>> of 43992)
>>>>>> ******************** TEST 'Clang ::
>>>>>> Preprocessor/include-leading-nonalpha-suggest.c' FAILED ********************
>>>>>> Script:
>>>>>> --
>>>>>> : 'RUN: at line 1';
>>>>>>  c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\clang.EXE
>>>>>> -cc1 -internal-isystem
>>>>>> c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\8.0.0\include
>>>>>> -nostdsysteminc
>>>>>> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c
>>>>>> -verify
>>>>>> --
>>>>>> Exit Code: 1
>>>>>>
>>>>>> Command Output (stdout):
>>>>>> --
>>>>>> $ ":" "RUN: at line 1"
>>>>>> $
>>>>>> "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\bin\clang.EXE"
>>>>>> "-cc1" "-internal-isystem"
>>>>>> "c:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.obj\lib\clang\8.0.0\include"
>>>>>> "-nostdsysteminc"
>>>>>> "C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c"
>>>>>> "-verify"
>>>>>> # command stderr:
>>>>>> error: 'error' diagnostics expected but not seen:
>>>>>>
>>>>>>   File
>>>>>> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\tools\clang\test\Preprocessor\include-leading-nonalpha-suggest.c
>>>>>> Line 3: '/empty_file_to_include.h' file not found, did you mean
>>>>>> 'empty_file_to_include.h'?
>>>>>>
>>>>>> 1 error generated.
>>>>>>
>>>>>>
>>>>>> error: command failed with exit status: 1
>>>>>>
>>>>>>
>>>>> Oof. Thanks. If I don't have something in 10 minutes I'll just revert.
>>>>>
>>>>> Thanks!
>>>>>
>>>>> -eric
>>>>>
>>>>>
>>>>>
>>>>>> Douglas Yung
>>>>>>
>>>>>> > -----Original Message-----
>>>>>> > From: cfe-commits [mailto:cfe-commits-bounces at lists.llvm.org] On
>>>>>> Behalf
>>>>>> > Of Eric Christopher via cfe-commits
>>>>>> > Sent: Thursday, September 20, 2018 10:23
>>>>>> > To: cfe-commits at lists.llvm.org
>>>>>> > Subject: r342668 - Add testcases for r342667.
>>>>>> >
>>>>>> > Author: echristo
>>>>>> > Date: Thu Sep 20 10:22:43 2018
>>>>>> > New Revision: 342668
>>>>>> >
>>>>>> > URL: http://llvm.org/viewvc/llvm-project?rev=342668&view=rev
>>>>>> > Log:
>>>>>> > Add testcases for r342667.
>>>>>> >
>>>>>> > Added:
>>>>>> >
>>>>>>  cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
>>>>>> >     cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
>>>>>> >
>>>>>> > Added: cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-
>>>>>> > suggest.c
>>>>>> > URL: http://llvm.org/viewvc/llvm-
>>>>>> > project/cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-
>>>>>> > suggest.c?rev=342668&view=auto
>>>>>> >
>>>>>> =======================================================================
>>>>>> > =======
>>>>>> > ---
>>>>>> cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
>>>>>> > (added)
>>>>>> > +++
>>>>>> cfe/trunk/test/Preprocessor/include-leading-nonalpha-no-suggest.c
>>>>>> > Thu Sep 20 10:22:43 2018
>>>>>> > @@ -0,0 +1,3 @@
>>>>>> > +// RUN: %clang_cc1 %s -verify
>>>>>> > +
>>>>>> > +#include "/non_existing_file_to_include.h" // expected-error
>>>>>> > {{'/non_existing_file_to_include.h' file not found}}
>>>>>> >
>>>>>> > Added:
>>>>>> cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
>>>>>> > URL: http://llvm.org/viewvc/llvm-
>>>>>> > project/cfe/trunk/test/Preprocessor/include-leading-nonalpha-
>>>>>> > suggest.c?rev=342668&view=auto
>>>>>> >
>>>>>> =======================================================================
>>>>>> > =======
>>>>>> > --- cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
>>>>>> > (added)
>>>>>> > +++ cfe/trunk/test/Preprocessor/include-leading-nonalpha-suggest.c
>>>>>> Thu
>>>>>> > Sep 20 10:22:43 2018
>>>>>> > @@ -0,0 +1,3 @@
>>>>>> > +// RUN: %clang_cc1 %s -verify
>>>>>> > +
>>>>>> > +#include "/empty_file_to_include.h" // expected-error
>>>>>> > {{'/empty_file_to_include.h' file not found, did you mean
>>>>>> > 'empty_file_to_include.h'?}}
>>>>>> >
>>>>>> >
>>>>>> > _______________________________________________
>>>>>> > cfe-commits mailing list
>>>>>> > cfe-commits at lists.llvm.org
>>>>>> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>>>>>
>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180920/206da274/attachment-0001.html>


More information about the cfe-commits mailing list