diff --git a/compiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp b/compiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp --- a/compiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp +++ b/compiler-rt/test/asan/TestCases/Posix/unpoison-alternate-stack.cpp @@ -6,6 +6,8 @@ // RUN: %clangxx_asan -std=c++20 -fexceptions -O0 %s -o %t -pthread // RUN: %run %t +// XFAIL: ios && !iossim + #include #include #include @@ -62,12 +64,14 @@ c.RightRedzone - c.LeftRedzone)); } +bool isOnSignalStack() { + stack_t Stack; + sigaltstack(nullptr, &Stack); + return Stack.ss_flags == SS_ONSTACK; +} + void signalHandler(int, siginfo_t *, void *) { - { - stack_t Stack; - sigaltstack(nullptr, &Stack); - assert(Stack.ss_flags == SS_ONSTACK); - } + assert(isOnSignalStack()); // test on signal alternate stack testOnCurrentStack(); @@ -110,6 +114,8 @@ // Test on signal alternate stack, via signalHandler poisonStackAndJump(defaultStack, [] { raise(SIGUSR1); }); + assert(!isOnSignalStack()); + assert(0 == __asan_region_is_poisoned( defaultStack.LeftRedzone, defaultStack.RightRedzone - defaultStack.LeftRedzone));