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
93 lines
3.9 KiB
C++
93 lines
3.9 KiB
C++
// Tests that the module dependency scan and the module dependency graph
|
|
// generation are correct.
|
|
// This test does not make use of any system inputs.
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %clang -std=c++23 -nostdlib -fmodules \
|
|
// RUN: -fmodules-driver -Rmodules-driver \
|
|
// RUN: -fmodule-map-file=%t/module.modulemap %t/main.cpp \
|
|
// RUN: -fmodules-cache-path=%t/modules-cache \
|
|
// RUN: %t/A.cppm %t/A-B.cppm %t/A-C.cppm %t/B.cppm -### 2>&1 \
|
|
// RUN: | sed 's:\\\\\?:/:g' \
|
|
// RUN: | FileCheck -DPREFIX=%/t %s
|
|
|
|
// CHECK: clang: remark: standard modules manifest file not found; import of standard library modules not supported [-Rmodules-driver]
|
|
// CHECK: clang: remark: printing module dependency graph [-Rmodules-driver]
|
|
// CHECK-NEXT: digraph "Module Dependency Graph" {
|
|
//
|
|
// CHECK: "transitive1-[[HASH_TRANSITIVE1:.*]]" [fillcolor=1, label="{ Module type: Clang module | Module name: transitive1 | Hash: [[HASH_TRANSITIVE1]] }"];
|
|
// CHECK-NEXT: "transitive2-[[HASH_TRANSITIVE2:.*]]" [fillcolor=1, label="{ Module type: Clang module | Module name: transitive2 | Hash: [[HASH_TRANSITIVE2]] }"];
|
|
// CHECK-NEXT: "direct1-[[HASH_DIRECT1:.*]]" [fillcolor=1, label="{ Module type: Clang module | Module name: direct1 | Hash: [[HASH_DIRECT1]] }"];
|
|
// CHECK-NEXT: "direct2-[[HASH_DIRECT2:.*]]" [fillcolor=1, label="{ Module type: Clang module | Module name: direct2 | Hash: [[HASH_DIRECT2]] }"];
|
|
// CHECK-NEXT: "root-[[HASH_ROOT:.*]]" [fillcolor=1, label="{ Module type: Clang module | Module name: root | Hash: [[HASH_ROOT]] }"];
|
|
// CHECK-NEXT: "[[PREFIX]]/main.cpp-[[TRIPLE:.*]]" [fillcolor=3, label="{ Filename: [[PREFIX]]/main.cpp | Triple: [[TRIPLE]] }"];
|
|
// CHECK-NEXT: "A-[[TRIPLE]]" [fillcolor=2, label="{ Filename: [[PREFIX]]/A.cppm | Module type: Named module | Module name: A | Triple: [[TRIPLE]] }"];
|
|
// CHECK-NEXT: "A:B-[[TRIPLE]]" [fillcolor=2, label="{ Filename: [[PREFIX]]/A-B.cppm | Module type: Named module | Module name: A:B | Triple: [[TRIPLE]] }"];
|
|
// CHECK-NEXT: "A:C-[[TRIPLE]]" [fillcolor=2, label="{ Filename: [[PREFIX]]/A-C.cppm | Module type: Named module | Module name: A:C | Triple: [[TRIPLE]] }"];
|
|
// CHECK-NEXT: "B-[[TRIPLE]]" [fillcolor=2, label="{ Filename: [[PREFIX]]/B.cppm | Module type: Named module | Module name: B | Triple: [[TRIPLE]] }"];
|
|
//
|
|
// CHECK: "transitive1-[[HASH_TRANSITIVE1]]" -> "direct1-[[HASH_DIRECT1]]";
|
|
// CHECK-NEXT: "transitive1-[[HASH_TRANSITIVE1]]" -> "direct2-[[HASH_DIRECT2]]";
|
|
// CHECK-NEXT: "transitive2-[[HASH_TRANSITIVE2]]" -> "direct1-[[HASH_DIRECT1]]";
|
|
// CHECK-NEXT: "direct1-[[HASH_DIRECT1]]" -> "root-[[HASH_ROOT]]";
|
|
// CHECK-NEXT: "direct1-[[HASH_DIRECT1]]" -> "A:B-[[TRIPLE]]";
|
|
// CHECK-NEXT: "direct2-[[HASH_DIRECT2]]" -> "root-[[HASH_ROOT]]";
|
|
// CHECK-NEXT: "root-[[HASH_ROOT]]" -> "[[PREFIX]]/main.cpp-[[TRIPLE]]";
|
|
// CHECK-NEXT: "root-[[HASH_ROOT]]" -> "B-[[TRIPLE]]";
|
|
// CHECK-NEXT: "A-[[TRIPLE]]" -> "[[PREFIX]]/main.cpp-[[TRIPLE]]";
|
|
// CHECK-NEXT: "A-[[TRIPLE]]" -> "B-[[TRIPLE]]";
|
|
// CHECK-NEXT: "A:B-[[TRIPLE]]" -> "A-[[TRIPLE]]";
|
|
// CHECK-NEXT: "A:C-[[TRIPLE]]" -> "A-[[TRIPLE]]";
|
|
// CHECK-NEXT: "B-[[TRIPLE]]" -> "[[PREFIX]]/main.cpp-[[TRIPLE]]";
|
|
// CHECK-NEXT: }
|
|
|
|
//--- module.modulemap
|
|
module root { header "root.h" }
|
|
module direct1 { header "direct1.h" }
|
|
module direct2 { header "direct2.h" }
|
|
module transitive1 { header "transitive1.h" }
|
|
module transitive2 { header "transitive2.h" }
|
|
|
|
//--- root.h
|
|
#include "direct1.h"
|
|
#include "direct2.h"
|
|
|
|
//--- direct1.h
|
|
#include "transitive1.h"
|
|
#include "transitive2.h"
|
|
|
|
//--- direct2.h
|
|
#include "transitive1.h"
|
|
|
|
//--- transitive1.h
|
|
// empty
|
|
|
|
//--- transitive2.h
|
|
// empty
|
|
|
|
//--- A.cppm
|
|
export module A;
|
|
export import :B;
|
|
import :C;
|
|
|
|
//--- A-B.cppm
|
|
module;
|
|
#include "direct1.h"
|
|
export module A:B;
|
|
|
|
//--- A-C.cppm
|
|
export module A:C;
|
|
|
|
//--- B.cppm
|
|
module;
|
|
#include "root.h"
|
|
export module B;
|
|
import A;
|
|
|
|
//--- main.cpp
|
|
#include "root.h"
|
|
import A;
|
|
import B;
|