xref: /llvm-project/clang/test/APINotes/search-order.m (revision 932949dbb517b089af28fdc480a16a738ee5db78)
1// RUN: rm -rf %t && mkdir -p %t
2
3// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -DFROM_FRAMEWORK=1 -verify
4
5// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %S/Inputs/APINotes  -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -DFROM_SEARCH_PATH=1 -verify
6
7// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/ModulesCache -fapinotes-modules -iapinotes-modules %S/Inputs/APINotes  -fsyntax-only -I %S/Inputs/Headers -F %S/Inputs/Frameworks %s -DFROM_FRAMEWORK=1 -verify
8
9@import SomeOtherKit;
10
11void test(A *a) {
12#if FROM_FRAMEWORK
13  [a methodA]; // expected-error{{unavailable}}
14  [a methodB];
15
16  // expected-note@SomeOtherKit/SomeOtherKit.h:5{{'methodA' has been explicitly marked unavailable here}}
17#elif FROM_SEARCH_PATH
18  [a methodA];
19  [a methodB]; // expected-error{{unavailable}}
20
21  // expected-note@SomeOtherKit/SomeOtherKit.h:6{{'methodB' has been explicitly marked unavailable here}}
22#else
23#  error Not something we need to test
24#endif
25}
26