Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / Preprocessor / nonportable-include-with-hmap.c
blob07907dfb40d5b1deb71e391b0f2152431b2b48b2
1 // REQUIRES: shell
2 // REQUIRES: case-insensitive-filesystem
4 // RUN: rm -f %t.hmap
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 \
9 // RUN: -I%t.hmap \
10 // RUN: -I%S/Inputs/nonportable-hmaps \
11 // RUN: %s -verify
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".
20 // 5. Return.
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`
29 // to be set.
30 #include "Bar.h"
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}}