brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 98c7f08 Raw
31 lines · plain
1REQUIRES: linux2RUN: %no_fuzzer_cpp_compiler %S/AFLDriverTest.cpp %libfuzzer_src/afl/afl_driver.cpp -o %t-AFLDriverTest3 4; Test that not specifying AFL_DRIVER_CLOSE_FD_MASK works as intended.5RUN: echo -n "abc" > %t.file36RUN: env -u AFL_DRIVER_CLOSE_FD_MASK %run %t-AFLDriverTest < %t.file3 2>&1 | FileCheck %s --check-prefixes=STDERR,STDOUT7STDOUT: STDOUT MESSAGE8STDERR: STDERR MESSAGE9 10; Test that stdout is closed properly.11RUN: env AFL_DRIVER_CLOSE_FD_MASK=1 %run %t-AFLDriverTest < %t.file3 2>&1 | FileCheck %s --check-prefixes=NOT_STDOUT,STDERR12NOT_STDOUT-NOT: STDOUT MESSAGE13 14; Test that stderr is closed properly.15RUN: env AFL_DRIVER_CLOSE_FD_MASK=2 %run %t-AFLDriverTest < %t.file3 2>&1 | FileCheck %s --check-prefixes=NOT_STDERR,STDOUT16NOT_STDERR-NOT: STDERR MESSAGE17 18; Test that both are closed properly.19RUN: env AFL_DRIVER_CLOSE_FD_MASK=3 %run %t-AFLDriverTest < %t.file3 2>&1 | FileCheck %s --check-prefixes=NOT_STDERR,NOT_STDOUT20 21; Test that a stack is printed when we close stderr22RUN: echo -n "abcd" > %t.file423RUN: env AFL_DRIVER_CLOSE_FD_MASK=2 not %run %t-AFLDriverTest < %t.file4 2>&1  | FileCheck %s --check-prefixes=ASAN_CRASH,STDOUT,NOT_STDERR24ASAN_CRASH: ERROR: AddressSanitizer25 26; Test that a stack is written to the stderr duplicate file when we close stderr27; and specify a duplicate.28RUN: rm -f %t.stderr29RUN: env AFL_DRIVER_STDERR_DUPLICATE_FILENAME=%t.stderr AFL_DRIVER_CLOSE_FD_MASK=2 not %run %t-AFLDriverTest < %t.file430RUN: cat %t.stderr | FileCheck %s --check-prefixes=ASAN_CRASH,NOT_STDERR31