Skip to content

Commit

Permalink
test: enable pthread-related libc-tests
Browse files Browse the repository at this point in the history
This change enables the pthread-related tests in the libc-test suite.
The tests are enabled only for the `wasm32-wasip1-threads` target, which
is the only target that supports threads at the moment.
  • Loading branch information
kateinoigakukun committed Jan 20, 2025
1 parent 930d16d commit 0e11f56
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ CFLAGS ?= --target=$(TARGET_TRIPLE) --sysroot=$(SYSROOT_DIR)
# Always include the `libc-test` infrastructure headers.
CFLAGS += -I$(INFRA_HEADERS_DIR)
ifneq ($(findstring -threads,$(TARGET_TRIPLE)),)
LDFLAGS += -Wl,--import-memory,--export-memory,--shared-memory,--max-memory=1073741824
CFLAGS += -pthread
endif

Expand Down Expand Up @@ -179,6 +180,7 @@ ifeq ($(TARGET_TRIPLE), wasm32-wasip2)
ENGINE += --wasm component-model
OBJPAT := $(OBJDIR)/%.component.wasm
else
ENGINE += --wasi threads
OBJPAT := $(OBJDIR)/%.core.wasm
endif

Expand Down
3 changes: 3 additions & 0 deletions test/src/libc-test/functional/pthread_cond.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! filter.py(TARGET_TRIPLE): wasm32-wasip1-threads
//! add-flags.py(CFLAGS): -I.
#include "build/download/libc-test/src/functional/pthread_cond.c"
3 changes: 3 additions & 0 deletions test/src/libc-test/functional/pthread_mutex.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! filter.py(TARGET_TRIPLE): wasm32-wasip1-threads
//! add-flags.py(CFLAGS): -I.
#include "build/download/libc-test/src/functional/pthread_mutex.c"
3 changes: 3 additions & 0 deletions test/src/libc-test/functional/pthread_tsd.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//! filter.py(TARGET_TRIPLE): wasm32-wasip1-threads
//! add-flags.py(CFLAGS): -I.
#include "build/download/libc-test/src/functional/pthread_tsd.c"

0 comments on commit 0e11f56

Please sign in to comment.