[clang-tools-extra] 41fa7d2 - [clangd] Fix a small inconsistency in system-include-extractor.test

Nathan Ridge via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 7 00:30:26 PST 2022


Author: Nathan Ridge
Date: 2022-11-07T03:29:42-05:00
New Revision: 41fa7d2093e0b7ff5f729b318643e8e177778feb

URL: https://github.com/llvm/llvm-project/commit/41fa7d2093e0b7ff5f729b318643e8e177778feb
DIFF: https://github.com/llvm/llvm-project/commit/41fa7d2093e0b7ff5f729b318643e8e177778feb.diff

LOG: [clangd] Fix a small inconsistency in system-include-extractor.test

Also add an explanatory comment

Differential Revision: https://reviews.llvm.org/D137056

Added: 
    

Modified: 
    clang-tools-extra/clangd/test/system-include-extractor.test

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/test/system-include-extractor.test b/clang-tools-extra/clangd/test/system-include-extractor.test
index c861a2346470e..b109aa67aad1c 100644
--- a/clang-tools-extra/clangd/test/system-include-extractor.test
+++ b/clang-tools-extra/clangd/test/system-include-extractor.test
@@ -11,9 +11,11 @@
 # RUN: echo '#!/bin/sh' >> %t.dir/bin/my_driver.sh
 # RUN: echo '[ "$0" = "%t.dir/bin/my_driver.sh" ] || exit' >> %t.dir/bin/my_driver.sh
 # RUN: echo 'args="$*"' >> %t.dir/bin/my_driver.sh
+# Check that clangd preserves certain flags like `-nostdinc` from
+# original invocation in compile_commands.json.
 # RUN: echo '[ -z "${args##*"-nostdinc"*}" ] || exit' >> %t.dir/bin/my_driver.sh
 # RUN: echo '[ -z "${args##*"-isysroot=/isysroot"*}" ] || exit' >> %t.dir/bin/my_driver.sh
-# RUN: echo 'echo " $* " | grep " --sysroot /my/sysroot/path " || exit' >> %t.dir/bin/my_driver.sh
+# RUN: echo '[ -z "${args##*"--sysroot /my/sysroot/path"*}" ] || exit' >> %t.dir/bin/my_driver.sh
 # RUN: echo 'echo line to ignore >&2' >> %t.dir/bin/my_driver.sh
 # RUN: echo 'printf "Target: arm-linux-gnueabihf\r\n" >&2' >> %t.dir/bin/my_driver.sh
 # RUN: echo 'printf "#include <...> search starts here:\r\n" >&2' >> %t.dir/bin/my_driver.sh


        


More information about the cfe-commits mailing list