-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clangd] Reduce instantiation depth in infinite-instantiations.test
#92888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clangd] Reduce instantiation depth in infinite-instantiations.test
#92888
Conversation
@llvm/pr-subscribers-clang-tools-extra @llvm/pr-subscribers-clangd Author: Vlad Serebrennikov (Endilll) ChangesThis patch reduces template instantiation depth in The following numbers are taken from https://buildkite.com/llvm-project/github-pull-requests/builds/65299, but they are the same for any CI run with clangd:
Windows:
Full diff: https://github.com/llvm/llvm-project/pull/92888.diff 1 Files Affected:
diff --git a/clang-tools-extra/clangd/test/infinite-instantiation.test b/clang-tools-extra/clangd/test/infinite-instantiation.test
index 85a1b656f4908..98260c075d240 100644
--- a/clang-tools-extra/clangd/test/infinite-instantiation.test
+++ b/clang-tools-extra/clangd/test/infinite-instantiation.test
@@ -1,5 +1,6 @@
-// RUN: cp %s %t.cpp
-// RUN: not clangd -check=%t.cpp 2>&1 | FileCheck -strict-whitespace %s
+// RUN: rm -rf %t.dir && mkdir -p %t.dir
+// RUN: echo '[{"directory": "%/t.dir", "command": "clang -ftemplate-depth=100 -x c++ %s", "file": "%s"}]' > %t.dir/compile_commands.json
+// RUN: not clangd --compile-commands-dir=%t.dir -check=%s 2>&1 | FileCheck -strict-whitespace %s
// CHECK: [template_recursion_depth_exceeded]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I added that test to check if the instantiation stack guard takes effect in clangd. And the change makes sense to me.
Linux CI passed, so I'm merging this. |
Addresses buildbot failure https://lab.llvm.org/buildbot/#/builders/123/builds/26913 caused by #92888
Fixing https://lab.llvm.org/buildbot/#/builders/123/builds/26934 caused by #92888. Third time the charm!
This patch reduces template instantiation depth in
infinite-instantiations.test
, because it doesn't seem to be concerned with the default instantiation depth in particular, but has a very material impact on testing times of clangd. Which subsequently affects CI run times for all Clang changes.The following numbers are taken from https://buildkite.com/llvm-project/github-pull-requests/builds/65299, but they are the same for any CI run with clangd:
Linux:
Windows: