mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
2972991969
We used to advertise private modules to be declared as submodules (Foo.Private). This has proven to not scale well since private headers might carry several dependencies, introducing unwanted content into the main module and often causing dep cycles. Change the canonical way to name it to Foo_Private, forcing private modules as top level ones, and provide warnings under -Wprivate-module to suggest fixes for other private naming. Update documentation to reflect that. rdar://problem/31173501 llvm-svn: 321337
29 lines
1.4 KiB
Objective-C
29 lines
1.4 KiB
Objective-C
// 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 -Wno-private-module
|
|
// 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 -Wno-private-module
|
|
// RUN: not diff %t.mcp/AddRemovePrivate.pcm %t/without.pcm
|
|
|
|
// expected-no-diagnostics
|
|
|
|
@import AddRemovePrivate;
|
|
#ifdef P
|
|
@import AddRemovePrivate.Private;
|
|
#endif
|