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
160 lines
4.2 KiB
C
160 lines
4.2 KiB
C
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
|
|
// Test that we warn when two modules own the same header (at include time).
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/headers \
|
|
// RUN: -fmodules-cache-path=%t/cache %t/tu.c -fsyntax-only \
|
|
// RUN: -Wduplicate-header-ownership -verify
|
|
|
|
// Test that the warning is off by default.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/headers \
|
|
// RUN: -fmodules-cache-path=%t/cache2 %t/tu-no-warn.c -fsyntax-only -verify
|
|
|
|
// Test that no warning fires if the conflicting header is not included.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/headers \
|
|
// RUN: -fmodules-cache-path=%t/cache3 %t/tu-no-include.c -fsyntax-only \
|
|
// RUN: -Wduplicate-header-ownership -verify
|
|
|
|
// Test umbrella header in different module conflicts with explicit header.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/umbrella \
|
|
// RUN: -fmodules-cache-path=%t/cache4 %t/tu-umbrella.c -fsyntax-only \
|
|
// RUN: -Wduplicate-header-ownership -verify
|
|
|
|
// Test umbrella dir in different module conflicts with explicit header.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/umbrella-dir \
|
|
// RUN: -fmodules-cache-path=%t/cache5 %t/tu-umbrella-dir.c -fsyntax-only \
|
|
// RUN: -Wduplicate-header-ownership -verify
|
|
|
|
// Test that explicit header + umbrella in the SAME module is fine.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/same-module \
|
|
// RUN: -fmodules-cache-path=%t/cache6 %t/tu-same-module.c -fsyntax-only \
|
|
// RUN: -Wduplicate-header-ownership -verify
|
|
|
|
// Test that excluded header under another module's umbrella is fine.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/excluded \
|
|
// RUN: -fmodules-cache-path=%t/cache7 %t/tu-excluded.c -fsyntax-only \
|
|
// RUN: -Wduplicate-header-ownership -verify
|
|
|
|
// Test umbrella header in subdirectory claiming parent dir conflicts with
|
|
// explicit header in parent dir.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/parent-umbrella \
|
|
// RUN: -fmodules-cache-path=%t/cache8 %t/tu-parent-umbrella.c -fsyntax-only \
|
|
// RUN: -Wduplicate-header-ownership -verify
|
|
|
|
//--- headers/a.h
|
|
|
|
//--- headers/b.h
|
|
|
|
//--- headers/module.modulemap
|
|
module A {
|
|
header "a.h"
|
|
}
|
|
|
|
module B {
|
|
header "a.h"
|
|
}
|
|
|
|
module C {
|
|
header "b.h"
|
|
}
|
|
|
|
//--- tu.c
|
|
#include "a.h"
|
|
// expected-warning@-1 {{header 'a.h' is owned by multiple modules}}
|
|
// expected-note@* {{header owned by module 'A' here}}
|
|
// expected-note@* {{header owned by module 'B' here}}
|
|
|
|
//--- tu-no-warn.c
|
|
// expected-no-diagnostics
|
|
#include "a.h"
|
|
|
|
//--- tu-no-include.c
|
|
// expected-no-diagnostics
|
|
#include "b.h"
|
|
|
|
//--- umbrella/umbrella.h
|
|
#include "d.h"
|
|
|
|
//--- umbrella/d.h
|
|
|
|
//--- umbrella/module.modulemap
|
|
module D {
|
|
umbrella header "umbrella.h"
|
|
}
|
|
|
|
module E {
|
|
header "d.h"
|
|
}
|
|
|
|
//--- tu-umbrella.c
|
|
#include "d.h"
|
|
// expected-warning@-1 {{header 'd.h' is owned by multiple modules}}
|
|
// expected-note@* {{header owned by module 'E' here}}
|
|
// expected-note@* {{header covered by umbrella for module 'D' here}}
|
|
|
|
//--- umbrella-dir/sub/e.h
|
|
|
|
//--- umbrella-dir/module.modulemap
|
|
module F {
|
|
umbrella "sub"
|
|
}
|
|
|
|
module G {
|
|
header "sub/e.h"
|
|
}
|
|
|
|
//--- tu-umbrella-dir.c
|
|
#include "sub/e.h"
|
|
// expected-warning@-1 {{header 'sub/e.h' is owned by multiple modules}}
|
|
// expected-note@* {{header owned by module 'G' here}}
|
|
// expected-note@* {{header covered by umbrella for module 'F' here}}
|
|
|
|
//--- same-module/sub/f.h
|
|
|
|
//--- same-module/module.modulemap
|
|
module H {
|
|
umbrella "sub"
|
|
header "sub/f.h"
|
|
}
|
|
|
|
//--- tu-same-module.c
|
|
// expected-no-diagnostics
|
|
#include "sub/f.h"
|
|
|
|
//--- excluded/sub/g.h
|
|
|
|
//--- excluded/module.modulemap
|
|
module I {
|
|
umbrella "sub"
|
|
exclude header "sub/g.h"
|
|
}
|
|
|
|
module J {
|
|
header "sub/g.h"
|
|
}
|
|
|
|
//--- tu-excluded.c
|
|
// expected-no-diagnostics
|
|
#include "sub/g.h"
|
|
|
|
//--- parent-umbrella/umb.h
|
|
//--- parent-umbrella/h.h
|
|
//--- parent-umbrella/sub/s.h
|
|
|
|
//--- parent-umbrella/sub/module.modulemap
|
|
module Umb {
|
|
umbrella header "../umb.h"
|
|
}
|
|
|
|
//--- parent-umbrella/module.modulemap
|
|
module K {
|
|
header "h.h"
|
|
}
|
|
|
|
//--- tu-parent-umbrella.c
|
|
#include "sub/s.h"
|
|
#include "h.h"
|
|
// expected-warning@-1 {{header 'h.h' is owned by multiple modules}}
|
|
// expected-note@* {{header owned by module 'K' here}}
|
|
// expected-note@* {{header covered by umbrella for module 'Umb' here}}
|