Bruno Cardoso Lopes | 29729919 | 2017-12-22 02:53:30 +0000 | [diff] [blame] | 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 | // CHECK: fix-it:"{{.*}}module.private.modulemap":{1:20-1:27}:"A_Private" |
| 17 | |
| 18 | #ifndef HEADER |
| 19 | #define HEADER |
| 20 | |
| 21 | #ifdef NO_AT_IMPORT |
| 22 | #import "A/aprivate.h" |
| 23 | #endif |
| 24 | |
| 25 | #ifdef USE_AT_IMPORT_PRIV |
| 26 | @import A.Private; |
| 27 | #endif |
| 28 | |
| 29 | #ifdef USE_AT_IMPORT_BOTH |
| 30 | @import A; |
| 31 | @import A.Private; |
| 32 | #endif |
| 33 | |
| 34 | const int *y = &APRIVATE; |
| 35 | |
| 36 | #endif |