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
61 lines
1.9 KiB
C++
61 lines
1.9 KiB
C++
// RUN: rm -rf %t
|
|
// RUN: mkdir -p %t
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cpp \
|
|
// RUN: -o %t/A.pcm
|
|
|
|
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/b.cpp \
|
|
// RUN: -fmodule-file=A=%t/A.pcm -o %t/B.pcm
|
|
|
|
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/c.cpp \
|
|
// RUN: -fmodule-file=A=%t/A.pcm -o %t/C.pcm
|
|
|
|
// RUN: %clang_cc1 -std=c++20 -verify %t/main.cpp \
|
|
// RUN: -fmodule-file=A=%t/A.pcm \
|
|
// RUN: -fmodule-file=B=%t/B.pcm \
|
|
// RUN: -fmodule-file=C=%t/C.pcm
|
|
|
|
// expected-no-diagnostics
|
|
|
|
//--- a.cpp
|
|
|
|
export module A;
|
|
export consteval const char *hello() { return "hello"; }
|
|
export constexpr const char *helloA0 = hello();
|
|
export constexpr const char *helloA1 = helloA0;
|
|
export constexpr const char *helloA2 = hello();
|
|
|
|
//--- b.cpp
|
|
|
|
export module B;
|
|
import A;
|
|
export constexpr const char *helloB1 = helloA0;
|
|
export constexpr const char *helloB2 = hello();
|
|
|
|
//--- c.cpp
|
|
|
|
export module C;
|
|
import A;
|
|
export constexpr const char *helloC1 = helloA1;
|
|
export constexpr const char *helloC2 = hello();
|
|
|
|
//--- main.cpp
|
|
|
|
import A;
|
|
import B;
|
|
import C;
|
|
|
|
// These are valid: they refer to the same evaluation of the same constant.
|
|
static_assert(helloA0 == helloA1);
|
|
static_assert(helloA0 == helloB1);
|
|
static_assert(helloA0 == helloC1);
|
|
|
|
// These refer to distinct evaluations, and so may or may not be equal.
|
|
static_assert(helloA1 == helloA2); // expected-error {{}} expected-note {{unspecified value}}
|
|
static_assert(helloA1 == helloB2); // expected-error {{}} expected-note {{unspecified value}}
|
|
static_assert(helloA1 == helloC2); // expected-error {{}} expected-note {{unspecified value}}
|
|
static_assert(helloA2 == helloB2); // expected-error {{}} expected-note {{unspecified value}}
|
|
static_assert(helloA2 == helloC2); // expected-error {{}} expected-note {{unspecified value}}
|
|
static_assert(helloB2 == helloC2); // expected-error {{}} expected-note {{unspecified value}}
|