[clang-tools-extra] 8edce2f - [test][clangd] Join back -Xclang and -undef

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 10:11:51 PDT 2022


Author: Vitaly Buka
Date: 2022-09-19T10:11:37-07:00
New Revision: 8edce2ff049d2fc635fc20c658daa283661a9958

URL: https://github.com/llvm/llvm-project/commit/8edce2ff049d2fc635fc20c658daa283661a9958
DIFF: https://github.com/llvm/llvm-project/commit/8edce2ff049d2fc635fc20c658daa283661a9958.diff

LOG: [test][clangd] Join back -Xclang and -undef

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/TestTU.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/TestTU.cpp b/clang-tools-extra/clangd/unittests/TestTU.cpp
index f7d294ca2c26..03f1cd77191d 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()) {


        


More information about the cfe-commits mailing list