1 # Check that libFuzzer honors SIGUSR1/SIGUSR2
2 # FIXME: Disabled on Windows for now because of reliance on posix only features
3 # (eg: export, "&", pkill).
5 UNSUPPORTED: darwin, target={{.*windows.*}}
8 RUN: %cpp_compiler %S/SleepOneSecondTest.cpp -o %t/LFSIGUSR
10 RUN: mkdir -p %t/C1 %t/C2
27 # Run in new session so we can easily kill child processes all at once.
28 RUN: setsid %run %t/LFSIGUSR -merge=1 -merge_control_file=%t/MCF %t/C1 %t/C2 2>%t/log & export PID=$!
30 RUN: kill -SIGUSR2 -$(ps -o sess= $PID | grep -o '[0-9]*')
31 RUN: wait $PID || true
33 RUN: cat %t/log | FileCheck %s --dump-input=fail
35 RUN: grep STARTED %t/MCF
36 RUN: tail -n 2 %t/MCF | grep FT
37 RUN: tail -n 1 %t/MCF | grep COV
39 CHECK: INFO: signal received, trying to exit gracefully
40 CHECK: INFO: libFuzzer: exiting as requested