brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 62c4942 Raw
65 lines · plain
1// XFAIL: target={{.*}}-aix{{.*}}, target={{.*}}-zos{{.*}}2// RUN: rm -rf %t3// RUN: split-file %s %t4// 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.cache6// 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.cache8// 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.cache10// 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.cache12 13// Test parsing duplicate Objective-C entities when a previous entity is defined14// in a hidden [sub]module and cannot be used.15//16// Testing with header guards and includes on purpose as tracking imports in17// modules is a separate issue.18 19//--- include/textual.h20#ifndef TEXTUAL_H21#define TEXTUAL_H22 23@protocol TestProtocol24- (void)someMethod;25@end26 27@protocol ForwardDeclaredProtocolWithoutDefinition;28 29id<TestProtocol> protocolDefinition(id<TestProtocol> t);30id<ForwardDeclaredProtocolWithoutDefinition> forwardDeclaredProtocol(31    id<ForwardDeclaredProtocolWithoutDefinition> t);32 33@interface NSObject @end34@class ForwardDeclaredInterfaceWithoutDefinition;35@interface NSObject(CategoryForTesting) @end36 37NSObject *interfaceDefinition(NSObject *o);38NSObject *forwardDeclaredInterface(NSObject *o);39 40#endif41 42//--- include/empty.h43//--- include/initially_hidden.h44#include "textual.h"45 46//--- include/module.modulemap47module Piecewise {48  module Empty {49    header "empty.h"50  }51  module InitiallyHidden {52    header "initially_hidden.h"53    export *54  }55}56 57//--- test.m58// Including empty.h loads the entire module Piecewise but keeps InitiallyHidden hidden.59#include "empty.h"60#include "textual.h"61#ifdef TEST_MAKE_HIDDEN_VISIBLE62#include "initially_hidden.h"63#endif64// expected-no-diagnostics65