CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
70 lines
2.4 KiB
C++
70 lines
2.4 KiB
C++
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
// RUN: %clang_cc1 -fimplicit-module-maps -fmodules-cache-path=%t -fmodules-strict-decluse -fmodule-name=lib_Private -I %t %t/lib.cpp -verify
|
|
|
|
//--- module.modulemap
|
|
// This simulates a modulemap that might reasonably be generated by a build system for something resembling the following.
|
|
// This can be used to perform strict dependency checking to ensure that your build graph is correctly declared.
|
|
// cc_library(
|
|
// name = "lib",
|
|
// # .cpp file in sources -> generate a compilation action with -fmodule-name=lib_Private
|
|
// # .h file in sources -> "textual header" in private modulemap
|
|
// sources = ["lib.cpp"],
|
|
// # headers -> "textual header" in public modulemap
|
|
// headers = ["lib.h"],
|
|
// # implementation_dep -> "use" in private modulemap
|
|
// implementation_deps = [":impl_dep"]
|
|
// # dep -> "use" in private and public modulemap
|
|
// deps = [":direct"],
|
|
// )
|
|
// cc_library(name = "direct", headers = ["direct.h"], deps = [":indirect"], ...)
|
|
// cc_library(name = "indirect", headers = ["indirect.h"], ..)
|
|
// cc_library(name = "impl_dep", headers = ["impl_dep.h"], ...)
|
|
module lib_Private {
|
|
use impl_dep
|
|
use lib
|
|
use direct
|
|
}
|
|
|
|
module lib {
|
|
textual header "lib.h"
|
|
use direct
|
|
}
|
|
|
|
|
|
module impl_dep {
|
|
textual header "impl_dep.h"
|
|
}
|
|
|
|
module direct {
|
|
textual header "direct.h"
|
|
use indirect
|
|
}
|
|
|
|
module indirect {
|
|
textual header "indirect.h"
|
|
}
|
|
|
|
//--- impl_dep.h
|
|
void impl_dep();
|
|
//--- direct.h
|
|
#include "impl_dep.h" // OK (it should only verify the main module).
|
|
void direct();
|
|
//--- indirect.h
|
|
void indirect();
|
|
//--- not_module.h
|
|
void not_module();
|
|
|
|
//--- lib.cpp
|
|
#include "lib.h"
|
|
#include "direct.h" // OK
|
|
#include "indirect.h" // expected-error {{module lib_Private does not directly depend on a module exporting 'indirect.h', which is part of indirectly-used module indirect}}
|
|
#include "impl_dep.h" // OK
|
|
#include "not_module.h" // expected-error {{module lib_Private does not depend on a module exporting 'not_module.h'}}
|
|
|
|
//--- lib.h
|
|
#include "direct.h" // OK
|
|
#include "indirect.h" // expected-error {{module lib does not directly depend on a module exporting 'indirect.h', which is part of indirectly-used module indirect}}
|
|
#include "impl_dep.h" // expected-error {{module lib does not depend on a module exporting 'impl_dep.h', which is part of module impl_dep, although its private module does}}
|
|
#include "not_module.h" // expected-error {{module lib does not depend on a module exporting 'not_module.h'}}
|