From f58fe877430c1c1240988b899b095ea0acf7ddb2 Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Tue, 9 Oct 2018 10:32:01 +0000 Subject: [PATCH] Use PTHREAD_STACK_MIN conditionally in a test PTHREAD_STACK_MIN is not available on NetBSD as it's not clear what the value shall be represented by this constant on a multiplatform OS. llvm-svn: 344034 --- compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc index 237c880..528fa94 100644 --- a/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc +++ b/compiler-rt/test/asan/TestCases/Posix/stack-use-after-return.cc @@ -78,9 +78,11 @@ int main(int argc, char **argv) { pthread_attr_init(&attr); if (kStackSize > 0) { size_t desired_stack_size = kStackSize; +#ifdef PTHREAD_STACK_MIN if (desired_stack_size < PTHREAD_STACK_MIN) { desired_stack_size = PTHREAD_STACK_MIN; } +#endif int ret = pthread_attr_setstacksize(&attr, desired_stack_size); if (ret != 0) { -- 2.7.4