2 // REQUIRES: case-insensitive-filesystem
5 // RUN: sed -e "s:INPUTS_DIR:%S/Inputs:g" \
6 // RUN: %S/Inputs/nonportable-hmaps/foo.hmap.json > %t.hmap.json
7 // RUN: %hmaptool write %t.hmap.json %t.hmap
8 // RUN: %clang_cc1 -Eonly \
10 // RUN: -I%S/Inputs/nonportable-hmaps \
13 // foo.hmap contains: Foo/Foo.h -> headers/foo/Foo.h
15 // Header search of "Foo/Foo.h" follows this path:
16 // 1. Look for "Foo/Foo.h".
17 // 2. Find "Foo/Foo.h" in "nonportable-hmaps/foo.hmap".
18 // 3. Look for "headers/foo/Foo.h".
19 // 4. Find "headers/foo/Foo.h" in "nonportable-hmaps".
22 // There is nothing nonportable; -Wnonportable-include-path should not fire.
23 #include "Foo/Foo.h" // no warning
25 // Verify files with absolute paths in the header map are handled too.
26 // "Bar.h" is included twice to make sure that when we see potentially
27 // nonportable path, the file has been already discovered through a relative
28 // path which triggers the file to be opened and `FileEntry::RealPathName`
31 #include "Foo/Bar.h" // no warning
33 // But the presence of the absolute path in the header map is not enough. If we
34 // didn't use it to discover a file, shouldn't suppress the warning.
35 #include "headers/Foo/Baz.h" // expected-warning {{non-portable path}}