[libc-commits] [PATCH] D128994: [libc] Add a separate algorithm_test.

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Jul 4 02:15:29 PDT 2022

gchatelet added subscribers: michaelrj, courbet, sivachandra.
gchatelet added a comment.

Ok I get it, kind of. `#include <string>` in the tests pulls a reference to pthread down in the GCC C++ library. I don't quite understand why but this is is resolved to llvm libc's header in the cmake build directory `/redacted_home/llvm-project_rel_compiled-with-clang/projects/libc/include/pthread.h`.
But that header is incomplete, the following symbols are missing : `pthread_key_t`, `pthread_once_t`, `pthread_cond_broadcast`, `pthread_cond_signal`, `pthread_cond_wait`, `pthread_cond_timedwait`.

Looking at the cmd line though, I can't find anything responsible for preferring llvm-libc headers over the system ones.

In fact I think we should have two types of tests:

1. Unit tests testing internal building blocks,
2. Functional tests testing the behavior of the libc interface.

In full build mode we should only run functional tests (2), this would allow us to use standard C++ in 1.
This can be done by splitting the `add_libc_unittest` function in : `add_libc_unittest` and `add_libc_functionaltest `
We could either have a separate `functionaltest` folder at the root of the project.

What do you think @sivachandra @courbet @michaelrj @lntue ?

In the meantime we could disable `algorithm_test` when FULLBUILD is enabled.

  rG LLVM Github Monorepo



More information about the libc-commits mailing list