2 // RUN: %clang_cc1 -Rmodule-include-translation -Wno-private-module -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -I %S/Inputs %s -verify -fmodule-feature custom_req1
3 // RUN: %clang_cc1 -Rmodule-include-translation -Wno-private-module -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -F %S/Inputs -I %S/Inputs %s -verify -std=c89 -DTEST_C_FEATURES
4 #ifndef TEST_C_FEATURES
5 // expected-error@DependsOnModule.framework/Modules/module.modulemap:7 {{module 'DependsOnModule.CXX' requires feature 'cplusplus'}}
6 @import DependsOnModule.CXX; // expected-note {{module imported here}}
7 @import DependsOnModule.NotCXX;
8 // expected-error@DependsOnModule.framework/Modules/module.modulemap:15 {{module 'DependsOnModule.NotObjC' is incompatible with feature 'objc'}}
9 @import DependsOnModule.NotObjC; // expected-note {{module imported here}}
10 @import DependsOnModule.CustomReq1; // OK
11 // expected-error@DependsOnModule.framework/Modules/module.modulemap:22 {{module 'DependsOnModule.CustomReq2' requires feature 'custom_req2'}}
12 @import DependsOnModule.CustomReq2; // expected-note {{module imported here}}
14 @import RequiresWithMissingHeader; // OK
15 // expected-error@module.modulemap:* {{module 'RequiresWithMissingHeader.HeaderBefore' requires feature 'missing'}}
16 @import RequiresWithMissingHeader.HeaderBefore; // expected-note {{module imported here}}
17 // expected-error@module.modulemap:* {{module 'RequiresWithMissingHeader.HeaderAfter' requires feature 'missing'}}
18 @import RequiresWithMissingHeader.HeaderAfter; // expected-note {{module imported here}}
19 // expected-error@DependsOnModule.framework/Modules/module.modulemap:40 {{module 'DependsOnModule.CXX11' requires feature 'cplusplus11'}}
20 @import DependsOnModule.CXX11; // expected-note {{module imported here}}
21 // expected-error@DependsOnModule.framework/Modules/module.modulemap:43 {{module 'DependsOnModule.CXX14' requires feature 'cplusplus14'}}
22 @import DependsOnModule.CXX14; // expected-note {{module imported here}}
23 // expected-error@DependsOnModule.framework/Modules/module.modulemap:46 {{module 'DependsOnModule.CXX17' requires feature 'cplusplus17'}}
24 @import DependsOnModule.CXX17; // expected-note {{module imported here}}
25 // expected-error@DependsOnModule.framework/Modules/module.modulemap:49 {{module 'DependsOnModule.CXX20' requires feature 'cplusplus20'}}
26 @import DependsOnModule.CXX20; // expected-note {{module imported here}}
27 // expected-error@DependsOnModule.framework/Modules/module.modulemap:52 {{module 'DependsOnModule.CXX23' requires feature 'cplusplus23'}}
28 @import DependsOnModule.CXX23; // expected-note {{module imported here}}
29 // expected-error@DependsOnModule.framework/Modules/module.modulemap:55 {{module 'DependsOnModule.CXX26' requires feature 'cplusplus26'}}
30 @import DependsOnModule.CXX26; // expected-note {{module imported here}}
32 // expected-error@DependsOnModule.framework/Modules/module.modulemap:58 {{module 'DependsOnModule.C99' requires feature 'c99'}}
33 @import DependsOnModule.C99; // expected-note {{module imported here}}
34 // expected-error@DependsOnModule.framework/Modules/module.modulemap:61 {{module 'DependsOnModule.C11' requires feature 'c11'}}
35 @import DependsOnModule.C11; // expected-note {{module imported here}}
36 // expected-error@DependsOnModule.framework/Modules/module.modulemap:64 {{module 'DependsOnModule.C17' requires feature 'c17'}}
37 @import DependsOnModule.C17; // expected-note {{module imported here}}
38 // expected-error@DependsOnModule.framework/Modules/module.modulemap:67 {{module 'DependsOnModule.C23' requires feature 'c23'}}
39 @import DependsOnModule.C23; // expected-note {{module imported here}}