Skip to content

Commit 890d59d

Browse files
test: enable pthread-related libc-tests
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.
1 parent 574b88d commit 890d59d

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

test/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ CFLAGS ?= --target=$(TARGET_TRIPLE) --sysroot=$(SYSROOT_DIR)
129129
# Always include the `libc-test` infrastructure headers.
130130
CFLAGS += -I$(INFRA_HEADERS_DIR)
131131
ifneq ($(findstring -threads,$(TARGET_TRIPLE)),)
132+
LDFLAGS += -Wl,--import-memory,--export-memory,--shared-memory,--max-memory=1073741824
132133
CFLAGS += -pthread
133134
endif
134135

@@ -179,6 +180,7 @@ ifeq ($(TARGET_TRIPLE), wasm32-wasip2)
179180
ENGINE += --wasm component-model
180181
OBJPAT := $(OBJDIR)/%.component.wasm
181182
else
183+
ENGINE += --wasi threads
182184
OBJPAT := $(OBJDIR)/%.core.wasm
183185
endif
184186

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

0 commit comments

Comments
 (0)