2012-11-01 04:59:50 +08:00
|
|
|
// REQUIRES: case-insensitive-filesystem
|
|
|
|
|
|
|
|
// Test this without pch.
|
2017-08-16 03:47:06 +08:00
|
|
|
// RUN: mkdir -p %t-dir
|
|
|
|
// RUN: cp %S/Inputs/case-insensitive-include.h %t-dir
|
|
|
|
// RUN: %clang_cc1 -Wno-nonportable-include-path -fsyntax-only %s -include %s -I %t-dir -verify
|
2012-11-01 04:59:50 +08:00
|
|
|
|
|
|
|
// Test with pch.
|
2017-08-16 03:47:06 +08:00
|
|
|
// RUN: %clang_cc1 -emit-pch -o %t.pch %s -I %t-dir
|
2012-11-01 04:59:50 +08:00
|
|
|
|
|
|
|
// Modify inode of the header.
|
2017-08-16 03:47:06 +08:00
|
|
|
// RUN: cp %t-dir/case-insensitive-include.h %t.copy
|
|
|
|
// RUN: touch -r %t-dir/case-insensitive-include.h %t.copy
|
|
|
|
// RUN: mv %t.copy %t-dir/case-insensitive-include.h
|
2012-11-01 04:59:50 +08:00
|
|
|
|
[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name
Summary:
InMemoryFileSystem::status behaves differently than
RealFileSystem::status. The Name contained in the Status returned by
RealFileSystem::status will be the path as requested by the caller,
whereas InMemoryFileSystem::status returns the normalized path.
For example, when requested the status for "../src/first.h",
RealFileSystem returns a Status with "../src/first.h" as the Name.
InMemoryFileSystem returns "/absolute/path/to/src/first.h".
The reason for this change is that I want to make a unit test in the
clangd testsuite (where we use an InMemoryFileSystem) to reproduce a
bug I get with the clangd program (where a RealFileSystem is used).
This difference in behavior "hides" the bug in the unit test version.
An indirect impact of this change is that a -Wnonportable-include-path
warning is now emitted in test PCH/case-insensitive-include.c. This is
because the real path of the included file (with the wrong case) was not
available previously, whereas it is now.
Reviewers: malaperle, ilya-biryukov, bkramer
Reviewed By: ilya-biryukov
Subscribers: eric_niebler, malaperle, omtcyfz, hokein, bkramer, ilya-biryukov, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D48903
llvm-svn: 339063
2018-08-07 05:48:20 +08:00
|
|
|
// RUN: %clang_cc1 -Wno-nonportable-include-path -fsyntax-only %s -include-pch %t.pch -I %t-dir -verify
|
2012-11-01 04:59:50 +08:00
|
|
|
|
|
|
|
// expected-no-diagnostics
|
|
|
|
|
|
|
|
#ifndef HEADER
|
|
|
|
#define HEADER
|
|
|
|
|
|
|
|
#include "case-insensitive-include.h"
|
|
|
|
#include "Case-Insensitive-Include.h"
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#include "Case-Insensitive-Include.h"
|
|
|
|
|
|
|
|
#endif
|