1 | // RUN: rm -rf %t |
2 | // RUN: rm -rf %t.mcp |
3 | // RUN: mkdir -p %t |
4 | // RUN: cp -r %S/Inputs/AddRemovePrivate.framework %t/AddRemovePrivate.framework |
5 | |
6 | // Build with module.private.modulemap |
7 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify -DP -Wno-private-module |
8 | // RUN: cp %t.mcp/AddRemovePrivate.pcm %t/with.pcm |
9 | |
10 | // Build without module.private.modulemap |
11 | // RUN: rm %t/AddRemovePrivate.framework/Modules/module.private.modulemap |
12 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify |
13 | // RUN: not diff %t.mcp/AddRemovePrivate.pcm %t/with.pcm |
14 | // RUN: cp %t.mcp/AddRemovePrivate.pcm %t/without.pcm |
15 | // RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -DP 2>&1 | FileCheck %s |
16 | // CHECK: no submodule named 'Private' |
17 | |
18 | // Build with module.private.modulemap (again) |
19 | // RUN: cp %S/Inputs/AddRemovePrivate.framework/Modules/module.private.modulemap %t/AddRemovePrivate.framework/Modules/module.private.modulemap |
20 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify -DP -Wno-private-module |
21 | // RUN: not diff %t.mcp/AddRemovePrivate.pcm %t/without.pcm |
22 | |
23 | // expected-no-diagnostics |
24 | |
25 | @import AddRemovePrivate; |
26 | #ifdef P |
27 | @import AddRemovePrivate.Private; |
28 | #endif |
29 | |