diff options
author | Manuel Klimek <klimek@google.com> | 2014-08-13 12:34:41 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2014-08-13 12:34:41 +0000 |
commit | c0ff99089aca5169abd74fdf2cd66f23e61f83d5 (patch) | |
tree | c45285ca3493e8e64add786dbae98f1266584f56 /clang/test/Modules/filename.cpp | |
parent | 2fe75b3a735ebe546e8ca6fa6163461fa86ce006 (diff) | |
download | bcm5719-llvm-c0ff99089aca5169abd74fdf2cd66f23e61f83d5.tar.gz bcm5719-llvm-c0ff99089aca5169abd74fdf2cd66f23e61f83d5.zip |
Default getFile() to use the last accessed name in the FileEntry.
With modules we start accessing headers for the first time while reading
the module map, which often has very different paths from the include
scanning logic.
Using the name by which the file was accessed gets us one step closer to
the right solution, which is using a FileName abstraction that decouples
the name by which a file was accessed from the FileEntry.
llvm-svn: 215541
Diffstat (limited to 'clang/test/Modules/filename.cpp')
-rw-r--r-- | clang/test/Modules/filename.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Modules/filename.cpp b/clang/test/Modules/filename.cpp new file mode 100644 index 00000000000..66891a04b74 --- /dev/null +++ b/clang/test/Modules/filename.cpp @@ -0,0 +1,9 @@ +// RUN: cd %S +// RUN: %clang_cc1 -I. -fmodule-maps -fmodule-name=A -fmodule-map-file=%S/Inputs/filename/module.map %s -E | FileCheck %s +// REQUIRES: shell + +#include "Inputs/filename/a.h" + +// Make sure that headers that are referenced by module maps have __FILE__ +// reflect the include path they were found with. +// CHECK: const char *p = "./Inputs/filename/a.h" |