llvm-capstone/clang/test/Modules/shadow-framework.m
Jan Svoboda dba2b5c931 [clang][modules] Skip submodule & framework re-definitions in module maps
Before D150478, there were situations when Clang avoided parsing a module map because it was likely to re-define an already defined module (either by a PCM or by previously-found module map). Since Clang no longer performs that check and does parse the extra module map (due to the FW/FW_Private issue described in D150478), this patch re-implements the same semantics by skipping the duplicate definition of the framework module while parsing the module map.

Depends on D150478.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D150479
2023-07-17 13:50:25 -07:00

21 lines
616 B
Objective-C

// RUN: rm -rf %t
// RUN: split-file %s %t
// This test checks that redefinitions of frameworks are ignored.
//--- include/module.modulemap
module first { header "first.h" }
module FW {}
//--- include/first.h
//--- frameworks/FW.framework/Modules/module.modulemap
framework module FW { header "FW.h" }
//--- frameworks/FW.framework/Headers/FW.h
//--- tu.c
#import "first.h" // expected-remark {{importing module 'first'}}
#import <FW/FW.h>
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t/cache -fimplicit-module-maps \
// RUN: -I %t/include -F %t/frameworks -fsyntax-only %t/tu.c -Rmodule-import -verify