diff options
Diffstat (limited to 'clang/test/Modules')
4 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/cxx_other.h b/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/cxx_other.h new file mode 100644 index 00000000000..724d7987af5 --- /dev/null +++ b/clang/test/Modules/Inputs/DependsOnModule.framework/Headers/cxx_other.h @@ -0,0 +1,5 @@ +class CXXOnly { + public: + CXXOnly(); + ~CXXOnly(); +}; diff --git a/clang/test/Modules/Inputs/DependsOnModule.framework/module.map b/clang/test/Modules/Inputs/DependsOnModule.framework/module.map index d8fe2fc3f52..2a3dd8038bd 100644 --- a/clang/test/Modules/Inputs/DependsOnModule.framework/module.map +++ b/clang/test/Modules/Inputs/DependsOnModule.framework/module.map @@ -4,6 +4,11 @@ framework module DependsOnModule { module * { export * } + explicit module CXX { + requires cplusplus + header "cxx_other.h" + } + explicit framework module SubFramework { umbrella header "SubFramework.h" diff --git a/clang/test/Modules/requires.m b/clang/test/Modules/requires.m new file mode 100644 index 00000000000..ceb03f32d3b --- /dev/null +++ b/clang/test/Modules/requires.m @@ -0,0 +1,5 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify + +__import_module__ DependsOnModule.CXX; // expected-error{{module 'DependsOnModule.CXX' requires feature 'cplusplus'}} + diff --git a/clang/test/Modules/subframeworks.m b/clang/test/Modules/subframeworks.m index 44b6746a4af..2e149cccdcc 100644 --- a/clang/test/Modules/subframeworks.m +++ b/clang/test/Modules/subframeworks.m @@ -1,5 +1,6 @@ // RUN: rm -rf %t // RUN: %clang_cc1 -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify +// RUN: %clang_cc1 -x objective-c++ -Wauto-import -fmodule-cache-path %t -fauto-module-import -F %S/Inputs %s -verify __import_module__ DependsOnModule; @@ -14,3 +15,8 @@ void testSubFrameworkAgain() { double *sfo1 = sub_framework_other; } +#ifdef __cplusplus +__import_module__ DependsOnModule.CXX; + +CXXOnly cxxonly; +#endif |