37 lines · c
1// Most likely platform specific sed differences2// UNSUPPORTED: system-windows3// REQUIRES: case-insensitive-filesystem4 5// RUN: rm -f %t.hmap6// RUN: sed -e "s:INPUTS_DIR:%S/Inputs:g" \7// RUN: %S/Inputs/nonportable-hmaps/foo.hmap.json > %t.hmap.json8// RUN: %hmaptool write %t.hmap.json %t.hmap9// RUN: %clang_cc1 -Eonly \10// RUN: -I%t.hmap \11// RUN: -I%S/Inputs/nonportable-hmaps \12// RUN: %s -verify13//14// foo.hmap contains: Foo/Foo.h -> headers/foo/Foo.h15//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 warning25 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 potentially28// nonportable path, the file has been already discovered through a relative29// 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 warning33 34// But the presence of the absolute path in the header map is not enough. If we35// didn't use it to discover a file, shouldn't suppress the warning.36#include "headers/Foo/Baz.h" // expected-warning {{non-portable path}}37