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
112 lines
2.2 KiB
C++
112 lines
2.2 KiB
C++
// RUN: rm -fR %t
|
|
// RUN: split-file %s %t
|
|
// RUN: cd %t
|
|
// RUN: %clang_cc1 -std=c++20 -fmodule-map-file=modules.map -xc++ -emit-module -fmodule-name=internal modules.map -o internal.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -fmodule-map-file=modules.map -xc++ -emit-module -fmodule-name=interface modules.map -o interface.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -fmodule-map-file=modules.map -xc++ -emit-module -fmodule-name=foo modules.map -o foo.pcm -fmodule-file=interface.pcm -fmodule-file=internal.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -fmodule-map-file=modules.map -O1 -emit-obj main.cc -verify -fmodule-file=foo.pcm
|
|
|
|
//--- modules.map
|
|
module "interface" {
|
|
export *
|
|
module "interface.h" {
|
|
export *
|
|
header "interface.h"
|
|
}
|
|
}
|
|
|
|
module "internal" {
|
|
export *
|
|
module "internal.h" {
|
|
export *
|
|
header "internal.h"
|
|
}
|
|
}
|
|
|
|
module "foo" {
|
|
export *
|
|
module "foo.h" {
|
|
export *
|
|
header "foo.h"
|
|
}
|
|
}
|
|
|
|
//--- foo.h
|
|
#ifndef FOO_H
|
|
#define FOO_H
|
|
|
|
#include "strong_int.h"
|
|
|
|
DEFINE_STRONG_INT_TYPE(CallbackId, int);
|
|
|
|
#define CALL_HASH(id) \
|
|
(void)[&]() { AbslHashValue(0, id); };
|
|
|
|
void test(CallbackId id) {
|
|
CALL_HASH(id);
|
|
}
|
|
|
|
#include "internal.h"
|
|
#include "interface.h"
|
|
|
|
#endif
|
|
|
|
//--- interface.h
|
|
#ifndef INTERFACE_H
|
|
#define INTERFACE_H
|
|
|
|
#include "strong_int.h"
|
|
|
|
DEFINE_STRONG_INT_TYPE(EndpointToken, int);
|
|
|
|
#endif
|
|
|
|
//--- internal.h
|
|
#ifndef INTERNAL_H
|
|
#define INTERNAL_H
|
|
|
|
#include "strong_int.h"
|
|
|
|
DEFINE_STRONG_INT_TYPE(OrderedListSortKey, int);
|
|
DEFINE_STRONG_INT_TYPE(OrderedListId, int);
|
|
|
|
#endif
|
|
|
|
//--- strong_int.h
|
|
#ifndef STRONG_INT_H
|
|
#define STRONG_INT_H
|
|
|
|
namespace util_intops {
|
|
|
|
template <typename TagType, typename NativeType>
|
|
class StrongInt2;
|
|
|
|
template <typename TagType, typename NativeType>
|
|
class StrongInt2 {
|
|
public:
|
|
template <typename H>
|
|
friend H AbslHashValue(H h, const StrongInt2& i) {
|
|
return h;
|
|
}
|
|
};
|
|
|
|
} // namespace util_intops
|
|
|
|
#define DEFINE_STRONG_INT_TYPE(type_name, value_type) \
|
|
struct type_name##_strong_int_tag_ {}; \
|
|
typedef ::util_intops::StrongInt2<type_name##_strong_int_tag_, value_type> \
|
|
type_name;
|
|
|
|
#endif
|
|
|
|
//--- main.cc
|
|
// expected-no-diagnostics
|
|
#include "foo.h"
|
|
|
|
#include "strong_int.h"
|
|
|
|
DEFINE_STRONG_INT_TYPE(ArchiveId2, int);
|
|
void partial(ArchiveId2 id) {
|
|
CALL_HASH(id);
|
|
}
|