31 lines · plain
1// FIXME: This test infinite loops on darwin because it crashes2// printing a stack trace repeatedly3UNSUPPORTED: darwin4 5// Verifies lib/fuzzer/scripts/unbalanced_allocs.py script6 7RUN: %cpp_compiler %S/TraceMallocTest.cpp -o %t-TraceMallocTest8 9# Specify python because we can't use the shebang line on Windows.10RUN: %run %t-TraceMallocTest -seed=1 -trace_malloc=1 -runs=200 2>&1 | \11RUN: %python %libfuzzer_src/scripts/unbalanced_allocs.py --skip=5 | FileCheck %s12 13RUN: %run %t-TraceMallocTest -seed=1 -trace_malloc=2 -runs=200 2>&1 | \14RUN: %python %libfuzzer_src/scripts/unbalanced_allocs.py --skip=5 | FileCheck %s --check-prefixes=CHECK,CHECK215 16CHECK: MallocFreeTracer: START17# Behavior of the format string "%p" is implementation defined. Account for the18# implementation on Windows and Linux.19CHECK: Unbalanced MALLOC[{{[0-9]+}}] [[PTR:(:?0x)?[0-9a-fA-F]+]] 420CHECK2-NEXT: {{ #0 0x[0-9a-f]+ in }}21CHECK2-NEXT: {{ #1 0x[0-9a-f]+ in }}22CHECK2-NEXT: {{ #2 0x[0-9a-f]+ in }}23CHECK: MallocFreeTracer: STOP24 25CHECK: MallocFreeTracer: START26CHECK: Unbalanced FREE[{{[0-9]+}}] [[PTR]]27CHECK2-NEXT: {{ #0 0x[0-9a-f]+ in }}28CHECK2-NEXT: {{ #1 0x[0-9a-f]+ in }}29CHECK2-NEXT: {{ #2 0x[0-9a-f]+ in }}30CHECK: MallocFreeTracer: STOP31