1 | // RUN: rm -rf %t |
2 | // Build PCH using A, with private submodule A.Private |
3 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DNO_AT_IMPORT |
4 | |
5 | // RUN: rm -rf %t |
6 | // Build PCH using A, with private submodule A.Private, check the fixit |
7 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -fdiagnostics-parseable-fixits -DNO_AT_IMPORT 2>&1 | FileCheck %s |
8 | |
9 | // RUN: rm -rf %t |
10 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DUSE_AT_IMPORT_PRIV |
11 | // RUN: rm -rf %t |
12 | // RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DUSE_AT_IMPORT_BOTH |
13 | |
14 | // expected-warning@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:1{{private submodule 'A.Private' in private module map, expected top-level module}} |
15 | // expected-note@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:1{{rename 'A.Private' to ensure it can be found by name}} |
16 | |
17 | // expected-warning@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:6{{private submodule 'B.Private' in private module map, expected top-level module}} |
18 | // expected-note@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:6{{rename 'B.Private' to ensure it can be found by name}} |
19 | |
20 | // expected-warning@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:9{{private submodule 'C.Private' in private module map, expected top-level module}} |
21 | // expected-note@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:9{{rename 'C.Private' to ensure it can be found by name}} |
22 | |
23 | // CHECK: fix-it:"{{.*}}module.private.modulemap":{1:1-1:27}:"framework module A_Private" |
24 | // CHECK: fix-it:"{{.*}}module.private.modulemap":{6:1-6:26}:"framework module B_Private" |
25 | // CHECK: fix-it:"{{.*}}module.private.modulemap":{9:1-9:36}:"framework module C_Private" |
26 | |
27 | #ifndef HEADER |
28 | #define HEADER |
29 | |
30 | #ifdef NO_AT_IMPORT |
31 | #import "A/aprivate.h" |
32 | #endif |
33 | |
34 | #ifdef USE_AT_IMPORT_PRIV |
35 | @import A.Private; |
36 | #endif |
37 | |
38 | #ifdef USE_AT_IMPORT_BOTH |
39 | @import A; |
40 | @import A.Private; |
41 | #endif |
42 | |
43 | const int *y = &APRIVATE; |
44 | |
45 | #endif |
46 | |