llvm-capstone/clang/test/Modules/modulemap-collision.m
Jan Svoboda 1afb313b26
[clang][modules] Use file name as requested (#68957)
This prevents redefinition errors due to having multiple paths for the
same module map. (rdar://24116019)

Originally implemented and tested downstream by @bcardosolopes, I just
made use of `FileEntryRef::getNameAsRequested()`.
2023-10-20 09:23:19 -07:00

16 lines
785 B
Objective-C

// REQUIRES: shell
// RUN: rm -rf %t
// RUN: mkdir -p %t/sources %t/build
// RUN: echo "// A.h" > %t/sources/A.h
// RUN: echo "framework module A {}" > %t/sources/module.modulemap
// RUN: echo "framework module A.Private { umbrella header \"A.h\" }" > %t/sources/module.private.modulemap
// RUN: cp %t/sources/module.modulemap %t/build/module.modulemap
// RUN: cp %t/sources/module.private.modulemap %t/build/module.private.modulemap
// RUN: sed -e "s:DUMMY_DIR:%t:g" %S/Inputs/all-product-headers.yaml > %t/build/all-product-headers.yaml
// RUN: %clang_cc1 -fsyntax-only -ivfsoverlay %t/build/all-product-headers.yaml -F%t/build -fmodules -fimplicit-module-maps -Wno-private-module -fmodules-cache-path=%t/cache -x objective-c %s -verify
// expected-no-diagnostics
#import <A/A.h>