diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-03-28 21:31:09 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-03-28 21:31:09 +0000 |
| commit | 8a3e39ab67222f6f2c1e6954c6536ad53414ab27 (patch) | |
| tree | 070f4460cb0324f2aae8ddeaccc649851a6dc431 /clang/test | |
| parent | 70b895908c0f1a1cb15b9cbe6e8c1470f439f2bc (diff) | |
| download | bcm5719-llvm-8a3e39ab67222f6f2c1e6954c6536ad53414ab27.tar.gz bcm5719-llvm-8a3e39ab67222f6f2c1e6954c6536ad53414ab27.zip | |
[modules] If both a module file and a module map for the same module are
explicitly provided, and the module map lists a header that does not exist,
unmark the module as 'unavailable' when loading its .pcm file. (Use of the
module might still fail if the relevant headers aren't embedded, but this
behavior is now consistent with how we behave if the module map is not
provided, and with the desired behavior for embedding headers in modules.)
llvm-svn: 264664
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Modules/embed-files.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/Modules/embed-files.cpp b/clang/test/Modules/embed-files.cpp index a1db21852d0..f300558dd7f 100644 --- a/clang/test/Modules/embed-files.cpp +++ b/clang/test/Modules/embed-files.cpp @@ -1,11 +1,17 @@ // RUN: rm -rf %t // RUN: mkdir %t -// RUN: echo 'module a { header "a.h" } module b { header "b.h" }' > %t/modulemap +// RUN: echo 'module a { header "a.h" header "x.h" } module b { header "b.h" }' > %t/modulemap // RUN: echo 'extern int t;' > %t/t.h // RUN: echo '#include "t.h"' > %t/a.h // RUN: echo '#include "t.h"' > %t/b.h +// RUN: echo '#include "t.h"' > %t/x.h // RUN: %clang_cc1 -fmodules -I%t -fmodules-cache-path=%t -fmodule-map-file=%t/modulemap -fmodules-embed-all-files %s -verify +// +// RUN: %clang_cc1 -fmodules -I%t -fmodules-embed-all-files %t/modulemap -fmodule-name=a -x c++ -emit-module -o %t/a.pcm +// RUN: %clang_cc1 -fmodules -I%t -fmodules-embed-all-files %t/modulemap -fmodule-name=b -x c++ -emit-module -o %t/b.pcm +// RUN: rm %t/x.h +// RUN: %clang_cc1 -fmodules -I%t -fmodule-map-file=%t/modulemap -fmodule-file=%t/a.pcm -fmodule-file=%t/b.pcm %s -verify #include "a.h" char t; // expected-error {{different type}} // expected-note@t.h:1 {{here}} |

