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