diff options
Diffstat (limited to 'test/Modules/strict-decluse-headers.cpp')
-rw-r--r-- | test/Modules/strict-decluse-headers.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Modules/strict-decluse-headers.cpp b/test/Modules/strict-decluse-headers.cpp new file mode 100644 index 0000000000000..deeda2fe7f4de --- /dev/null +++ b/test/Modules/strict-decluse-headers.cpp @@ -0,0 +1,17 @@ +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: touch %t/foo.h +// RUN: echo '#include "foo.h"' > %t/bar.h +// RUN: touch %t/baz.h +// RUN: echo 'module X { header "bar.h" header "baz.h" }' > %t/map +// +// RUN: not %clang_cc1 -fsyntax-only -fmodules -fmodule-map-file=%t/map -I%t -fmodules-strict-decluse -fmodule-name=X -x c++ %t/bar.h %t/baz.h 2>&1 | FileCheck %s +// RUN: not %clang_cc1 -fsyntax-only -fmodules -fmodule-map-file=%t/map -I%t -fmodules-strict-decluse -fmodule-name=X -x c++ %t/baz.h %t/bar.h 2>&1 | FileCheck %s +// +// Don't crash on this: (FIXME: we should produce an error that the specified module name is not known) +// RUN: %clang_cc1 -fsyntax-only -fmodules -I%t -fmodules-strict-decluse -fmodule-name=X -x c++ %t/baz.h %t/bar.h +// +// Don't crash on this: (FIXME: we should produce an error that the specified file is not part of the specified module) +// RUN: %clang_cc1 -fsyntax-only -fmodules -fmodule-map-file=%t/map -I%t -fmodules-strict-decluse -fmodule-name=X -x c++ %t/foo.h +// +// CHECK: module X does not depend on a module exporting 'foo.h' |