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
122 lines
3.8 KiB
C++
122 lines
3.8 KiB
C++
// Checks that driver-generated options for C++ module inputs preserve the
|
|
// canonical module build commands compared to an equivalent non-module input,
|
|
// and that they do not produce additional internal scanning PCMs.
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
|
|
//--- main.cpp
|
|
#include "root.h"
|
|
import A;
|
|
import B;
|
|
|
|
auto main() -> int { return 1; }
|
|
|
|
//--- A.cppm
|
|
module;
|
|
#include "root.h"
|
|
export module A;
|
|
|
|
//--- B.cppm
|
|
module;
|
|
#include "root.h"
|
|
export module B;
|
|
|
|
//--- module.modulemap
|
|
module root { header "root.h" }
|
|
|
|
//--- root.h
|
|
// empty
|
|
|
|
// RUN: %clang -std=c++23 -fmodules \
|
|
// RUN: -fmodules-cache-path=%t/modules-cache \
|
|
// RUN: %t/main.cpp %t/A.cppm %t/B.cppm \
|
|
// RUN: -fsyntax-only -fdriver-only -MJ %t/deps.json
|
|
//
|
|
// RUN: sed -e '1s/^/[/' -e '$s/,$/]/' -e 's:\\\\\?:/:g' %t/deps.json \
|
|
// RUN: > %t/compile_commands.json
|
|
//
|
|
// RUN: clang-scan-deps \
|
|
// RUN: -compilation-database=%t/compile_commands.json \
|
|
// RUN: -format experimental-full \
|
|
// RUN: | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
|
|
|
|
// CHECK: {
|
|
// CHECK-NEXT: "modules": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "clang-module-deps": [],
|
|
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
|
|
// CHECK: "context-hash": "[[HASH_ROOT:.*]]",
|
|
// CHECK-NEXT: "file-deps": [
|
|
// CHECK-NEXT: "[[PREFIX]]/module.modulemap",
|
|
// CHECK-NEXT: "[[PREFIX]]/root.h"
|
|
// CHECK-NEXT: ],
|
|
// CHECK-NEXT: "link-libraries": [],
|
|
// CHECK-NEXT: "name": "root"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ],
|
|
// CHECK-NEXT: "translation-units": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "commands": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "clang-context-hash": "{{.*}}",
|
|
// CHECK-NEXT: "named-module-deps": [
|
|
// CHECK-NEXT: "A",
|
|
// CHECK-NEXT: "B"
|
|
// CHECK-NEXT: ],
|
|
// CHECK-NEXT: "clang-module-deps": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "context-hash": "[[HASH_ROOT]]",
|
|
// CHECK-NEXT: "module-name": "root"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ],
|
|
// CHECK: "file-deps": [
|
|
// CHECK-NEXT: "[[PREFIX]]/main.cpp"
|
|
// CHECK-NEXT: ],
|
|
// CHECK-NEXT: "input-file": "[[PREFIX]]/main.cpp"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ]
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "commands": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "clang-context-hash": "{{.*}}",
|
|
// CHECK-NEXT: "named-module": "A",
|
|
// CHECK-NEXT: "clang-module-deps": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "context-hash": "[[HASH_ROOT]]",
|
|
// CHECK-NEXT: "module-name": "root"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ],
|
|
// CHECK: "file-deps": [
|
|
// CHECK-NEXT: "[[PREFIX]]/A.cppm"
|
|
// CHECK-NEXT: ],
|
|
// CHECK-NEXT: "input-file": "[[PREFIX]]/A.cppm"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ]
|
|
// CHECK-NEXT: },
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "commands": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "clang-context-hash": "{{.*}}",
|
|
// CHECK-NEXT: "named-module": "B",
|
|
// CHECK-NEXT: "clang-module-deps": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "context-hash": "[[HASH_ROOT]]",
|
|
// CHECK-NEXT: "module-name": "root"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ],
|
|
// CHECK: "file-deps": [
|
|
// CHECK-NEXT: "[[PREFIX]]/B.cppm"
|
|
// CHECK-NEXT: ],
|
|
// CHECK-NEXT: "input-file": "[[PREFIX]]/B.cppm"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ]
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ]
|
|
// CHECK-NEXT: }
|
|
|
|
// This tests that the scanner doesn't produce multiple internal scanning PCMs
|
|
// for our single Clang module (root).
|
|
// RUN: find %t/modules-cache -name "*.pcm" | wc -l | grep 1
|