Files
TheRock/compiler/amd-llvm/clang/test/Modules/deprecated-upwards-relative-path.m
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

82 lines
2.5 KiB
Objective-C

// RUN: rm -rf %t
// RUN: split-file %s %t
// Test that we warn on upwards relative paths in implicitly discovered module maps.
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/sub \
// RUN: -fmodules-cache-path=%t/cache %t/tu.m -fsyntax-only \
// RUN: -Wmodule-map-path-outside-directory -verify
// Test that we don't warn when the module map is explicitly specified.
// RUN: %clang_cc1 -fmodules -fmodule-map-file=%t/sub/module.modulemap \
// RUN: -fmodules-cache-path=%t/cache2 %t/tu-no-warn.m -fsyntax-only \
// RUN: -Wmodule-map-path-outside-directory -verify
// Test umbrella header with upwards relative path.
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/umbrella-header/sub \
// RUN: -fmodules-cache-path=%t/cache3 %t/umbrella-header/tu.m -fsyntax-only \
// RUN: -Wmodule-map-path-outside-directory -verify
// Test umbrella directory with upwards relative path.
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/umbrella-dir/sub \
// RUN: -fmodules-cache-path=%t/cache4 %t/umbrella-dir/tu.m -fsyntax-only \
// RUN: -Wmodule-map-path-outside-directory -verify
// Test that interior .. that escapes the directory is caught.
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -I%t/interior/sub \
// RUN: -fmodules-cache-path=%t/cache5 %t/interior/tu.m -fsyntax-only \
// RUN: -Wmodule-map-path-outside-directory -verify
//--- a.h
void a(void);
//--- sub/module.modulemap
module A {
header "../a.h"
}
//--- tu.m
@import A;
// expected-warning@*{{path refers outside of the module directory; such paths in implicitly discovered module maps are deprecated}}
//--- tu-no-warn.m
// expected-no-diagnostics
@import A;
//--- umbrella-header/inc/b.h
void b(void);
//--- umbrella-header/sub/module.modulemap
module B {
umbrella header "../inc/b.h"
}
//--- umbrella-header/tu.m
@import B;
// expected-warning@*{{path refers outside of the module directory; such paths in implicitly discovered module maps are deprecated}}
//--- umbrella-dir/inc/c.h
void c(void);
//--- umbrella-dir/sub/module.modulemap
module C {
umbrella "../inc"
}
//--- umbrella-dir/tu.m
@import C;
// expected-warning@*{{path refers outside of the module directory; such paths in implicitly discovered module maps are deprecated}}
//--- interior/d.h
void d(void);
//--- interior/sub/inner/placeholder.h
//--- interior/sub/module.modulemap
module D {
header "inner/../../d.h"
}
//--- interior/tu.m
@import D;
// expected-warning@*{{path refers outside of the module directory; such paths in implicitly discovered module maps are deprecated}}