From 8edce2ff049d2fc635fc20c658daa283661a9958 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 19 Sep 2022 10:10:42 -0700 Subject: [PATCH] [test][clangd] Join back -Xclang and -undef --- clang-tools-extra/clangd/unittests/TestTU.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clang-tools-extra/clangd/unittests/TestTU.cpp b/clang-tools-extra/clangd/unittests/TestTU.cpp index f7d294c..03f1cd7 100644 --- a/clang-tools-extra/clangd/unittests/TestTU.cpp +++ b/clang-tools-extra/clangd/unittests/TestTU.cpp @@ -40,12 +40,14 @@ ParseInputs TestTU::inputs(MockFS &FS) const { ParseInputs Inputs; Inputs.FeatureModules = FeatureModules; auto &Argv = Inputs.CompileCommand.CommandLine; - Argv = {"clang", "-Xclang"}; + Argv = {"clang"}; // In tests, unless explicitly specified otherwise, omit predefined macros // (__GNUC__ etc) for a 25% speedup. There are hundreds, and we'd generate, // parse, serialize, and re-parse them! - if (!PredefineMacros) + if (!PredefineMacros) { + Argv.push_back("-Xclang"); Argv.push_back("-undef"); + } // FIXME: this shouldn't need to be conditional, but it breaks a // GoToDefinition test for some reason (getMacroArgExpandedLocation fails). if (!HeaderCode.empty()) { -- 2.7.4