diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-09 08:48:41 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-09 08:48:41 +0000 |
commit | 0f99d6a4413e3da6ec242c0ab715d6699045dea8 (patch) | |
tree | 4ae2e591505c54ad7078c0d5235c3c9cbef143b5 /clang/test/Modules/explicit-build-missing-files.cpp | |
parent | 38c1e6d355e45f73539326a3a1dee1ce0c5738b7 (diff) | |
download | llvm-0f99d6a4413e3da6ec242c0ab715d6699045dea8.zip llvm-0f99d6a4413e3da6ec242c0ab715d6699045dea8.tar.gz llvm-0f99d6a4413e3da6ec242c0ab715d6699045dea8.tar.bz2 |
[modules] PR22534: Load files specified by -fmodule-file= eagerly. In particular, this avoids the need to re-parse module map files when using such a module.
llvm-svn: 244416
Diffstat (limited to 'clang/test/Modules/explicit-build-missing-files.cpp')
-rw-r--r-- | clang/test/Modules/explicit-build-missing-files.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Modules/explicit-build-missing-files.cpp b/clang/test/Modules/explicit-build-missing-files.cpp new file mode 100644 index 0000000..2ea157b --- /dev/null +++ b/clang/test/Modules/explicit-build-missing-files.cpp @@ -0,0 +1,21 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: echo 'extern int a;' > %t/a.h +// RUN: echo 'extern int b;' > %t/b.h +// RUN: echo 'module a { header "a.h" header "b.h" }' > %t/modulemap + +// We lazily check that the files referenced by an explicitly-specified .pcm +// file exist. Test this by removing files and ensuring that the compilation +// still succeeds. +// +// RUN: %clang_cc1 -fmodules -I %t -emit-module -fmodule-name=a -x c++ %t/modulemap -o %t/a.pcm +// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s +// RUN: rm %t/modulemap +// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s +// RUN: rm %t/b.h +// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s +// RUN: rm %t/a.h +// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -verify + +#include "a.h" // expected-error {{file not found}} +int x = b; |