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
64 lines
1.7 KiB
C++
64 lines
1.7 KiB
C++
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
// RUN: cd %t
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/a.cppm -o %t/a.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/b.cppm -o %t/b.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/c.cpp \
|
|
// RUN: -fprebuilt-module-path=%t
|
|
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/d.cpp \
|
|
// RUN: -fprebuilt-module-path=%t
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/h.cppm \
|
|
// RUN: -fprebuilt-module-path=%t -o %t/h.pcm
|
|
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %t/j.cpp \
|
|
// RUN: -fprebuilt-module-path=%t
|
|
|
|
//--- a.cppm
|
|
export module a;
|
|
export void foo() {
|
|
|
|
}
|
|
|
|
//--- b.cppm
|
|
export module b;
|
|
void bar();
|
|
export void foo() {
|
|
bar();
|
|
}
|
|
|
|
//--- c.cpp
|
|
// expected-no-diagnostics
|
|
// Since we will load all the declaration lazily, we won't be able to find
|
|
// the ODR violation here.
|
|
import a;
|
|
import b;
|
|
|
|
//--- d.cpp
|
|
import a;
|
|
import b;
|
|
// Test that we can still check the odr violation if we call the function
|
|
// actually.
|
|
void use() {
|
|
foo(); // expected-error@* {{'foo' has different definitions in different modules;}}
|
|
// expected-note@* {{but in 'a' found a different body}}
|
|
}
|
|
|
|
// expected-error@a.cppm:* {{declaration 'foo' attached to named module 'a' cannot be attached to other modules}}
|
|
// expected-note@b.cppm:* {{}}
|
|
|
|
//--- h.cppm
|
|
export module h;
|
|
export import a;
|
|
export import b;
|
|
|
|
//--- j.cpp
|
|
import h;
|
|
void use() {
|
|
foo(); // expected-error@* {{'foo' has different definitions in different modules;}}
|
|
// expected-note@* {{but in 'a' found a different body}}
|
|
}
|
|
|
|
// expected-error@a.cppm:* {{declaration 'foo' attached to named module 'a' cannot be attached to other modules}}
|
|
// expected-note@b.cppm:* {{}}
|