236
|
1 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
|
|
2 #include "test.h"
|
|
3 #include <signal.h>
|
|
4 #include <sys/types.h>
|
|
5
|
|
6 static void handler(int, siginfo_t *, void *) {
|
|
7 write(2, "SIGNAL\n", 7);
|
|
8 // CHECK: SIGNAL
|
|
9 _exit(0);
|
|
10 // CHECK-NOT: ThreadSanitizer: signal-unsafe call
|
|
11 }
|
|
12
|
|
13 int main() {
|
|
14 struct sigaction act = {};
|
|
15 act.sa_sigaction = &handler;
|
|
16 act.sa_flags = SA_SIGINFO;
|
|
17 sigaction(SIGPROF, &act, 0);
|
|
18 raise(SIGPROF);
|
|
19 fprintf(stderr, "DONE\n");
|
|
20 // CHECK-NOT: DONE
|
|
21 return 0;
|
|
22 }
|