1 // RUN: %clang_tsan -O1 %s -o %t && %deflake %run %t | FileCheck %s
2 // This test fails on powerpc64 BE (VMA=44), it does not appear to be
3 // a functional problem, but the Tsan report is missing some info.
4 // XFAIL: target=powerpc64-unknown-linux-gnu{{.*}}
14 static void MyHandler(int, siginfo_t
*s
, void *c
) {
19 static void* sendsignal(void *p
) {
20 barrier_wait(&barrier
);
21 pthread_kill(mainth
, SIGPROF
);
25 static __attribute__((noinline
)) void loop() {
26 barrier_wait(&barrier
);
28 volatile char *p
= (char*)malloc(1);
36 barrier_init(&barrier
, 2);
37 mainth
= pthread_self();
38 struct sigaction act
= {};
39 act
.sa_sigaction
= &MyHandler
;
40 sigaction(SIGPROF
, &act
, 0);
42 pthread_create(&th
, 0, sendsignal
, 0);
48 // CHECK: WARNING: ThreadSanitizer: signal handler spoils errno
49 // CHECK: Signal 27 handler invoked at:
50 // CHECK: #0 MyHandler(int, {{(__)?}}siginfo{{(_t)?}}*, void*) {{.*}}signal_errno.cpp
52 // CHECK: SUMMARY: ThreadSanitizer: signal handler spoils errno{{.*}}MyHandler