diff options
Diffstat (limited to 'lib/tsan/lit_tests/signal_errno.cc')
-rw-r--r-- | lib/tsan/lit_tests/signal_errno.cc | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/tsan/lit_tests/signal_errno.cc b/lib/tsan/lit_tests/signal_errno.cc deleted file mode 100644 index 2febca38294ec..0000000000000 --- a/lib/tsan/lit_tests/signal_errno.cc +++ /dev/null @@ -1,43 +0,0 @@ -// RUN: %clang_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s -#include <pthread.h> -#include <stdio.h> -#include <stdlib.h> -#include <signal.h> -#include <sys/types.h> -#include <unistd.h> -#include <errno.h> - -pthread_t mainth; -volatile int done; - -static void MyHandler(int, siginfo_t *s, void *c) { - errno = 1; - done = 1; -} - -static void* sendsignal(void *p) { - pthread_kill(mainth, SIGPROF); - return 0; -} - -int main() { - mainth = pthread_self(); - struct sigaction act = {}; - act.sa_sigaction = &MyHandler; - sigaction(SIGPROF, &act, 0); - pthread_t th; - pthread_create(&th, 0, sendsignal, 0); - while (done == 0) { - volatile char *p = (char*)malloc(1); - p[0] = 0; - free((void*)p); - pthread_yield(); - } - pthread_join(th, 0); - return 0; -} - -// CHECK: WARNING: ThreadSanitizer: signal handler spoils errno -// CHECK: #0 MyHandler(int, siginfo{{(_t)?}}*, void*) {{.*}}signal_errno.cc -// CHECK: SUMMARY: ThreadSanitizer: signal handler spoils errno{{.*}}MyHandler - |