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
99 lines
3.2 KiB
C
99 lines
3.2 KiB
C
// REQUIRES: symlinks
|
|
|
|
// Test that we warn when including a symlink to a modular header that isn't
|
|
// covered by a module map at the symlink's location.
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
|
|
// Create the symlink directories and symlinks.
|
|
// RUN: mkdir -p %t/covered %t/uncovered
|
|
// RUN: ln -s %t/ModuleA/A.h %t/covered/A.h
|
|
// RUN: ln -s %t/ModuleA/A.h %t/uncovered/A.h
|
|
|
|
// Including the symlink that IS covered should not warn.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/covered -I%t/ModuleA \
|
|
// RUN: -fmodules-cache-path=%t/cache -fsyntax-only %t/tu-covered.m \
|
|
// RUN: -Wmmap-deprecated-symlink-to-modular-header -verify
|
|
|
|
// Including the symlink that is NOT covered should warn.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/uncovered -I%t/ModuleA \
|
|
// RUN: -fmodules-cache-path=%t/cache -fsyntax-only %t/tu-uncovered.m \
|
|
// RUN: -Wmmap-deprecated-symlink-to-modular-header -verify
|
|
|
|
// Same test with lazy module map loading.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/uncovered -I%t/ModuleA \
|
|
// RUN: -fmodules-cache-path=%t/cache2 -fmodules-lazy-load-module-maps \
|
|
// RUN: -fsyntax-only %t/tu-uncovered.m \
|
|
// RUN: -Wmmap-deprecated-symlink-to-modular-header -verify
|
|
|
|
// Test the diagnostic when the module is loaded from a PCM. Import B which
|
|
// transitively builds A into a PCM, then include A.h via the uncovered
|
|
// symlink so A is loaded from the PCM.
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t \
|
|
// RUN: -fmodules-cache-path=%t/cache3 -fsyntax-only %t/tu-uncovered-pcm.m \
|
|
// RUN: -Wmmap-deprecated-symlink-to-modular-header \
|
|
// RUN: -fno-modules-check-relocated -Rmodule-map -verify
|
|
|
|
//--- ModuleA/module.modulemap
|
|
module A {
|
|
header "A.h"
|
|
}
|
|
|
|
//--- ModuleA/A.h
|
|
|
|
//--- ModuleB/module.modulemap
|
|
module B {
|
|
header "B.h"
|
|
export *
|
|
}
|
|
|
|
//--- ModuleB/B.h
|
|
#include "ModuleA/A.h"
|
|
|
|
//--- covered/module.modulemap
|
|
module SymlinkA {
|
|
header "A.h"
|
|
}
|
|
|
|
//--- tu-covered.m
|
|
// expected-no-diagnostics
|
|
#include "A.h"
|
|
|
|
//--- tu-uncovered.m
|
|
#pragma clang __debug module_lookup A
|
|
#include "A.h"
|
|
|
|
// expected-warning-re@* {{may be a symlink to '{{.*}}' owned by module 'A'}}
|
|
// expected-note@ModuleA/module.modulemap:1 {{module defined here}}
|
|
|
|
//--- tu-uncovered-pcm.m
|
|
#include "ModuleB/B.h"
|
|
#include "uncovered/A.h"
|
|
|
|
// expected-warning-re@* {{may be a symlink to '{{.*}}' owned by module 'A'}}
|
|
// expected-note@ModuleA/module.modulemap:1 {{module defined here}}
|
|
// expected-remark-re@* {{loading modulemap '{{.*}}ModuleB/module.modulemap'}}
|
|
// expected-remark-re@* {{loading modulemap '{{.*}}module.modulemap'}}
|
|
// expected-remark-re@* {{loading modulemap '{{.*}}pthread.modulemap'}}
|
|
|
|
// RUN: ln -s pthread/pthread.h %t/pthread.h
|
|
// RUN: %clang_cc1 -fmodules-cache-path=%t/modules -fmodules -fimplicit-module-maps -I %t %t/tu.c -fsyntax-only \
|
|
// RUN: -Wmmap-deprecated-symlink-to-modular-header -verify
|
|
|
|
//--- module.modulemap
|
|
extern module pthread "pthread.modulemap"
|
|
|
|
//--- pthread.modulemap
|
|
module pthread { header "pthread/pthread.h" }
|
|
|
|
//--- pthread/pthread.h
|
|
typedef int p;
|
|
|
|
//--- tu.c
|
|
#include <pthread.h>
|
|
p P = 4;
|
|
|
|
// expected-warning-re@* {{may be a symlink to '{{.*}}' owned by module 'pthread'}}
|
|
// expected-note@pthread.modulemap:1 {{module defined here}}
|