Index: unittests/clangd/XRefsTests.cpp =================================================================== --- unittests/clangd/XRefsTests.cpp +++ unittests/clangd/XRefsTests.cpp @@ -584,7 +584,11 @@ auto FooH = testPath("foo.h"); auto FooHUri = URIForFile{FooH}; - const char *HeaderContents = R"cpp([[]]int a;)cpp"; + const char *HeaderContents = R"cpp([[]]#ifndef TEST_H_ + #define TEST_H_ + int a; + #endif + )cpp"; Annotations HeaderAnnotations(HeaderContents); FS.Files[FooH] = HeaderAnnotations.code();