[libc-commits] [PATCH] D147985: [LIBC] Implement `sched_yield()`

Noah Goldstein via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Apr 11 22:36:14 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: libc/test/src/sched/yield_test.cpp:9
+
+#include "src/__support/OSUtil/syscall.h"
+#include "src/errno/libc_errno.h"
----------------
sivachandra wrote:
> goldstein.w.n wrote:
> > michaelrj wrote:
> > > Nit: I'm not sure you need to include syscall here.
> > Fixed. 1 more unrelated question if you have the time.
> > 
> > I'm working on adding support for proper attr handling in `pthread_create`, but am finding normal libc tests / build doesn't include pthread (on linux).
> > 
> > Any idea for the extra steps to build/test pthread?
> > I'm working on adding support for proper attr handling in `pthread_create`, but am finding normal libc tests / build doesn't include pthread (on linux).
> > 
> > Any idea for the extra steps to build/test pthread?
> 
> Depends on what you mean by "normal libc tests". If you are running `check-libc` on linux, it should already be including the pthread tests. But, you can run pthread tests by running `libc-integration-tests` or use a more focused target `libc-pthread-integration-tests`. The tests live here: https://github.com/llvm/llvm-project/tree/main/libc/test/integration/src/pthread
> > I'm working on adding support for proper attr handling in `pthread_create`, but am finding normal libc tests / build doesn't include pthread (on linux).
> > 
> > Any idea for the extra steps to build/test pthread?
> 
> Depends on what you mean by "normal libc tests". If you are running `check-libc` on linux, it should already be including the pthread tests. 

Hmm, I'm noticing in a variety of cases some tests are skipped (including the entire pthread suite).
Building:
```
cmake -S llvm -B build -G Ninja -DLLVM_ENABLE_PROJECTS='libc;llvm;clang' -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="-O1 -Wno-address" -DCMAKE_C_FLAGS="-O1 -Wno-address" -DLLVM_ENABLE_RTTI=ON -DLLVM_ENABLE_EH=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_INSTALL_PREFIX=/home/noah/programs/opensource/llvm-dev/build -DLLVM_CCACHE_BUILD=ON -DLLVM_BINUTILS_INCDIR=/home/noah/programs/opensource/binutils-dev/src/binutils-gdb/include/plugin-api.h
```

and testing with `ninja check-libc`

Anything inherently wrong with that?

> But, you can run pthread tests by running `libc-integration-tests` or use a more focused target `libc-pthread-integration-tests`. The tests live here: https://github.com/llvm/llvm-project/tree/main/libc/test/integration/src/pthread




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147985/new/

https://reviews.llvm.org/D147985



More information about the libc-commits mailing list