diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-14 05:02:58 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-14 05:02:58 +0000 |
commit | fb1e7f7d1aca7bcfc341e9214bda8b554f5ae9b6 (patch) | |
tree | 093ac406bd59d18b3971e52091ad0204b6e0032a /clang/test/Modules/explicit-build-missing-files.cpp | |
parent | 526ff155467dd70f79ee8bcf65a801a0f989b19e (diff) | |
download | llvm-fb1e7f7d1aca7bcfc341e9214bda8b554f5ae9b6.zip llvm-fb1e7f7d1aca7bcfc341e9214bda8b554f5ae9b6.tar.gz llvm-fb1e7f7d1aca7bcfc341e9214bda8b554f5ae9b6.tar.bz2 |
[modules] Add an experimental -cc1 feature to embed the contents of an input
file in the .pcm files. This allows a smaller set of files to be sent to a
remote build worker when building with explicit modules (for instance, module
map files need not be sent along with the corresponding precompiled modules).
This doesn't actually make the embedded files visible to header search, so
it's not useful as a packaging format for public header files.
llvm-svn: 245028
Diffstat (limited to 'clang/test/Modules/explicit-build-missing-files.cpp')
-rw-r--r-- | clang/test/Modules/explicit-build-missing-files.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/clang/test/Modules/explicit-build-missing-files.cpp b/clang/test/Modules/explicit-build-missing-files.cpp index b556da9..8d5b94e 100644 --- a/clang/test/Modules/explicit-build-missing-files.cpp +++ b/clang/test/Modules/explicit-build-missing-files.cpp @@ -1,19 +1,26 @@ // RUN: rm -rf %t // RUN: mkdir %t -// RUN: echo 'extern int a;' > %t/a.h -// RUN: echo 'extern int b; template<typename T> int b2 = T::error;' > %t/b.h -// RUN: echo 'module a { header "a.h" header "b.h" }' > %t/modulemap +// RUN: echo 'extern int a; template<typename T> int a2 = T::error;' > %t/a.h +// RUN: echo 'extern int b;' > %t/b.h +// RUN: echo 'extern int c = 0;' > %t/c.h +// RUN: echo 'module a { header "a.h" header "b.h" header "c.h" }' > %t/modulemap +// RUN: echo 'module other {}' > %t/other.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 -emit-module -fmodule-name=a -x c++ %t/modulemap -o %t/a.pcm \ +// RUN: -fmodule-map-file=%t/other.modulemap \ +// RUN: -fmodules-embed-file=%t/modulemap -fmodules-embed-file=%t/other.modulemap // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s // RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -DERRORS 2>&1 | FileCheck %s // RUN: rm %t/modulemap // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s // RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -DERRORS 2>&1 | FileCheck %s +// RUN: rm %t/other.modulemap +// RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s +// RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -DERRORS 2>&1 | FileCheck %s // RUN: rm %t/b.h // RUN: %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s // RUN: not %clang_cc1 -fmodules -I %t -fmodule-file=%t/a.pcm %s -DERRORS 2>&1 | FileCheck %s --check-prefix=MISSING-B @@ -24,10 +31,14 @@ int x = b; #ifdef ERRORS -int y = b2<int>; +int y = a2<int>; // CHECK: In module 'a': -// CHECK-NEXT: b.h:1:45: error: +// CHECK-NEXT: a.h:1:45: error: // MISSING-B: could not find file '{{.*}}b.h' // MISSING-B-NOT: please delete the module cache #endif + +// RUN: not %clang_cc1 -fmodules -I %t -emit-module -fmodule-name=a -x c++ /dev/null -o %t/a.pcm \ +// RUN: -fmodules-embed-file=%t/does-not-exist 2>&1 | FileCheck %s --check-prefix=MISSING-EMBED +// MISSING-EMBED: fatal error: file '{{.*}}does-not-exist' specified by '-fmodules-embed-file=' not found |