Skip to content

Commit 5b614eb

Browse files
committed
[lldb] Let dotest check for the cassert header instead of algorithm for libc++ check
This is just a dotest check to see if we can compile a simple program that uses libc++. Right now we are parsing the rather big `algorithm` header in the test program, but the test really just checks whether we can find *any* libc++ headers and link against some libc++ SO. Using the much smaller `cassert` header for checking whether we can find libc++ headers speeds up this check by a bit. After some incredibly unscientific performance testing this saves a few seconds when running the test suite on Linux (on macOS we hardcoded that libc++ is always there, so this check won't be used there and we don't save any time). Reviewed By: jankratochvil Differential Revision: https://reviews.llvm.org/D101056
1 parent 0e7c7d4 commit 5b614eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/packages/Python/lldbsuite/test/dotest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ def canRunLibcxxTests():
751751
with tempfile.NamedTemporaryFile() as f:
752752
cmd = [configuration.compiler, "-xc++", "-stdlib=libc++", "-o", f.name, "-"]
753753
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
754-
_, stderr = p.communicate("#include <algorithm>\nint main() {}")
754+
_, stderr = p.communicate("#include <cassert>\nint main() {}")
755755
if not p.returncode:
756756
return True, "Compiling with -stdlib=libc++ works"
757757
return False, "Compiling with -stdlib=libc++ fails with the error: %s" % stderr

0 commit comments

Comments
 (0)