https://bugs.llvm.org/show_bug.cgi?id=46187

            Bug ID: 46187
           Summary: tests in ClangScanDeps fail on Windows due to bad path
                    concatenation
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: dcough...@apple.com
          Reporter: ctetr...@quicinc.com
                CC: dcough...@apple.com, llvm-bugs@lists.llvm.org

The following tests fail on Windows:

Clang :: ClangScanDeps/header_stat_before_open.m
Clang :: ClangScanDeps/static-analyzer.c
Clang :: ClangScanDeps/vfsoverlay.cpp

After troubleshooting, I narrowed the issue down to line 785 of
clang/lib/Lex/HeaderSearch.cpp. On this line, rather than calling
llvm::sys::path::append, a filename is constructed by pushing '/' onto the end
of the directory name, then doing a string concat to append the file name. This
has a few issues including:

- not correctly handling directory names with an existing trailing path
separator
- not correctly handling windows path separators

A fix had previously been pushed
(https://github.com/llvm/llvm-project/commit/1cf6c28a9c0c507a224889263a20df42fd791cb9),
then reverted
(https://github.com/llvm/llvm-project/commit/cf385dc8879f05581e94944d8ae7f00138c9ed72)
for this. I attempted to restore the fix to see why it was reverted and noted
that it causes several test failures:

Clang-Unit.Tooling/Syntax/_/SyntaxTests_exe::TokenCollectorTest.MultiFile
Clang-Unit.Tooling/_/ToolingTests_exe::TransformerTest.MultipleFiles
Clang.Index/skip-parsed-bodies::compile_commands.json
Clang.Misc::remap-file.c
Clang.Modules::filename.cpp
Clang.Modules::malformed.cpp
Clang.Modules::module-debuginfo-prefix.m
Clang.Preprocessor::file_test_windows.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to