[libc-commits] [libc] 7db91b4 - [libc] Fix pthread_create_test for 32 bit systems (#66564)
via libc-commits
libc-commits at lists.llvm.org
Fri Sep 22 07:10:11 PDT 2023
Author: Mikhail R. Gadelha
Date: 2023-09-22T10:10:07-04:00
New Revision: 7db91b4abe4123ea0efc1175d1afdc4d04fe5839
URL: https://github.com/llvm/llvm-project/commit/7db91b4abe4123ea0efc1175d1afdc4d04fe5839
DIFF: https://github.com/llvm/llvm-project/commit/7db91b4abe4123ea0efc1175d1afdc4d04fe5839.diff
LOG: [libc] Fix pthread_create_test for 32 bit systems (#66564)
The test tries to set the guard_size and stack_size of a thread to
SIZE_MAX / 4, which is a huge value in 64-bit systems but 1GB in 32-bit
ones.
We increase the size to 3 * (SIZE_MAX / 4) so it can also fail in 32-bit
systems.
Added:
Modified:
libc/test/integration/src/pthread/pthread_create_test.cpp
Removed:
################################################################################
diff --git a/libc/test/integration/src/pthread/pthread_create_test.cpp b/libc/test/integration/src/pthread/pthread_create_test.cpp
index 20a1139efbfa1ed..c8d512343586f66 100644
--- a/libc/test/integration/src/pthread/pthread_create_test.cpp
+++ b/libc/test/integration/src/pthread/pthread_create_test.cpp
@@ -287,7 +287,7 @@ static void run_failure_tests() {
run_failure_config(PTHREAD_STACK_MIN, SIZE_MAX);
run_failure_config(PTHREAD_STACK_MIN, SIZE_MAX - PTHREAD_STACK_MIN);
run_failure_config(SIZE_MAX / 2, SIZE_MAX / 2);
- run_failure_config(SIZE_MAX / 4, SIZE_MAX / 4);
+ run_failure_config(3 * (SIZE_MAX / 4), SIZE_MAX / 4);
run_failure_config(SIZE_MAX / 2 + 1234, SIZE_MAX / 2);
// Test invalid parameters that are impossible to obtain via the
More information about the libc-commits
mailing list