xref: /llvm-project/clang/test/Preprocessor/include-header-missing-in-framework.c (revision 421380a108167a27db2a93e8e6ae40cb44a9c3fd)
1*421380a1SVolodymyr Sapsai // RUN: %clang_cc1 -fsyntax-only -F %S/Inputs -verify %s
2*421380a1SVolodymyr Sapsai // RUN: %clang_cc1 -fsyntax-only -F %S/Inputs -DTYPO_CORRECTION -verify %s
3*421380a1SVolodymyr Sapsai 
4*421380a1SVolodymyr Sapsai // After finding a requested framework, we don't look for the same framework in
5*421380a1SVolodymyr Sapsai // a different location even if requested header is not found in the framework.
6*421380a1SVolodymyr Sapsai // It can be confusing when there is a framework with required header later in
7*421380a1SVolodymyr Sapsai // header search paths. Mention in diagnostics where the header lookup stopped.
8*421380a1SVolodymyr Sapsai 
9*421380a1SVolodymyr Sapsai #ifndef TYPO_CORRECTION
10*421380a1SVolodymyr Sapsai #include <TestFramework/NotExistingHeader.h>
11*421380a1SVolodymyr Sapsai // expected-error@-1 {{'TestFramework/NotExistingHeader.h' file not found}}
12*421380a1SVolodymyr Sapsai // expected-note@-2 {{did not find header 'NotExistingHeader.h' in framework 'TestFramework' (loaded from}}
13*421380a1SVolodymyr Sapsai 
14*421380a1SVolodymyr Sapsai #else
15*421380a1SVolodymyr Sapsai // Don't emit extra note for unsuccessfully typo-corrected include.
16*421380a1SVolodymyr Sapsai #include <#TestFramework/NotExistingHeader.h>
17*421380a1SVolodymyr Sapsai // expected-error@-1 {{'#TestFramework/NotExistingHeader.h' file not found}}
18*421380a1SVolodymyr Sapsai #endif // TYPO_CORRECTION
19