1 // XFAIL: target={{.*}}-aix{{.*}}, target={{.*}}-zos{{.*}}
3 // RUN: split-file %s %t
4 // RUN: %clang_cc1 -emit-llvm -o %t/test.bc -I %t/include %t/test.m -verify \
5 // RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
6 // RUN: %clang_cc1 -emit-llvm -o %t/test.bc -I %t/include %t/test.m -verify -DTEST_MAKE_HIDDEN_VISIBLE=1 \
7 // RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
8 // RUN: %clang_cc1 -emit-llvm -o %t/test.bc -I %t/include %t/test.m -verify -x objective-c++ \
9 // RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
10 // RUN: %clang_cc1 -emit-llvm -o %t/test.bc -I %t/include %t/test.m -verify -DTEST_MAKE_HIDDEN_VISIBLE=1 -x objective-c++ \
11 // RUN: -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/modules.cache
13 // Test parsing duplicate Objective-C entities when a previous entity is defined
14 // in a hidden [sub]module and cannot be used.
16 // Testing with header guards and includes on purpose as tracking imports in
17 // modules is a separate issue.
19 //--- include/textual.h
23 @protocol TestProtocol
27 @protocol ForwardDeclaredProtocolWithoutDefinition;
29 id<TestProtocol> protocolDefinition(id<TestProtocol> t);
30 id<ForwardDeclaredProtocolWithoutDefinition> forwardDeclaredProtocol(
31 id<ForwardDeclaredProtocolWithoutDefinition> t);
33 @interface NSObject @end
34 @class ForwardDeclaredInterfaceWithoutDefinition;
35 @interface NSObject(CategoryForTesting) @end
37 NSObject *interfaceDefinition(NSObject *o);
38 NSObject *forwardDeclaredInterface(NSObject *o);
43 //--- include/initially_hidden.h
46 //--- include/module.modulemap
51 module InitiallyHidden {
52 header "initially_hidden.h"
58 // Including empty.h loads the entire module Piecewise but keeps InitiallyHidden hidden.
61 #ifdef TEST_MAKE_HIDDEN_VISIBLE
62 #include "initially_hidden.h"
64 // expected-no-diagnostics