3 // RUN: split-file %s %t
4 // RUN: %clang_cc1 -emit-llvm -o %t/test.bc -F%t/Frameworks %t/test.m -Werror=objc-method-access -DHIDDEN_FIRST=1 \
5 // RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
6 // RUN: %clang_cc1 -emit-llvm -o %t/test.bc -F%t/Frameworks %t/test.m -Werror=objc-method-access -DHIDDEN_FIRST=0 \
7 // RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
9 // Test a case when Objective-C protocol is imported both as hidden and as visible.
11 //--- Frameworks/Foundation.framework/Headers/Foundation.h
15 //--- Frameworks/Foundation.framework/Modules/module.modulemap
16 framework module Foundation {
21 //--- Frameworks/Common.framework/Headers/Common.h
22 #import <Foundation/Foundation.h>
24 @interface Common : NSObject
25 - (id<Testing>)getProtocolObj;
28 //--- Frameworks/Common.framework/Modules/module.modulemap
29 framework module Common {
34 //--- Frameworks/Regular.framework/Headers/Regular.h
36 - (void)protocolMethod;
39 //--- Frameworks/Regular.framework/Modules/module.modulemap
40 framework module Regular {
45 //--- Frameworks/RegularHider.framework/Headers/Visible.h
46 // Empty, file required to create a module.
48 //--- Frameworks/RegularHider.framework/Headers/Hidden.h
50 - (void)protocolMethod;
53 //--- Frameworks/RegularHider.framework/Modules/module.modulemap
54 framework module RegularHider {
58 explicit module Hidden {
65 #import <Common/Common.h>
68 #import <RegularHider/Visible.h>
69 #import <Regular/Regular.h>
71 #import <Regular/Regular.h>
72 #import <RegularHider/Visible.h>
75 void test(Common *obj) {
76 [[obj getProtocolObj] protocolMethod];