1 // RUN: %clang_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
13 static void MyHandler(int, siginfo_t
*s
, void *c
) {
18 static void* sendsignal(void *p
) {
20 pthread_kill(mainth
, SIGPROF
);
24 static __attribute__((noinline
)) void loop() {
26 volatile char *p
= (char*)malloc(1);
34 mainth
= pthread_self();
35 struct sigaction act
= {};
36 act
.sa_sigaction
= &MyHandler
;
37 sigaction(SIGPROF
, &act
, 0);
39 pthread_create(&th
, 0, sendsignal
, 0);
45 // CHECK: WARNING: ThreadSanitizer: signal handler spoils errno
46 // CHECK: #0 MyHandler(int, siginfo{{(_t)?}}*, void*) {{.*}}signal_errno.cc
48 // CHECK: SUMMARY: ThreadSanitizer: signal handler spoils errno{{.*}}MyHandler