summaryrefslogtreecommitdiff
path: root/test/Modules/add-remove-private.m
blob: dc73a096c8079d66a5c171d1d64d69ddb3673a1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// RUN: rm -rf %t
// RUN: rm -rf %t.mcp
// RUN: mkdir -p %t
// RUN: cp -r %S/Inputs/AddRemovePrivate.framework %t/AddRemovePrivate.framework

// Build with module.private.modulemap
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify -DP
// RUN: cp %t.mcp/AddRemovePrivate.pcm %t/with.pcm

// Build without module.private.modulemap
// RUN: rm %t/AddRemovePrivate.framework/Modules/module.private.modulemap
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify
// RUN: not diff %t.mcp/AddRemovePrivate.pcm %t/with.pcm
// RUN: cp %t.mcp/AddRemovePrivate.pcm %t/without.pcm
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -DP 2>&1 | FileCheck %s
// CHECK: no submodule named 'Private'

// Build with module.private.modulemap (again)
// RUN: cp %S/Inputs/AddRemovePrivate.framework/Modules/module.private.modulemap %t/AddRemovePrivate.framework/Modules/module.private.modulemap
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t.mcp -fdisable-module-hash -F %t %s -verify -DP
// RUN: not diff %t.mcp/AddRemovePrivate.pcm %t/without.pcm

// expected-no-diagnostics

@import AddRemovePrivate;
#ifdef P
@import AddRemovePrivate.Private;
#endif