// RUN: %target-swiftc_driver %s -target %sanitizers-target-triple -g -sanitize=scudo -o %t_scudo-binary
// RUN: not %target-run %t_scudo-binary 2>&1 | %FileCheck %s
// REQUIRES: executable_test
// REQUIRES: OS=linux-gnu
// REQUIRES: scudo_runtime

let allocated = UnsafeMutableRawPointer.allocate(byteCount: 128, alignment: 1)
allocated.deallocate()
allocated.deallocate()

// CHECK: ERROR: invalid chunk state

// RUN: %target-swiftc_driver %s -target %sanitizers-target-triple -g -sanitize=scudo -o %t_scudo-binary
// RUN: not %target-run %t_scudo-binary 2>&1 | %FileCheck %s
// REQUIRES: executable_test
// REQUIRES: OS=linux-gnu
// REQUIRES: scudo_runtime

let allocated = UnsafeMutableRawPointer.allocate(byteCount: 128, alignment: 1)
allocated.deallocate()
allocated.deallocate()

// CHECK: {{ERROR: invalid chunk state|\*\*\* GWP-ASan detected a memory error \*\*\*}}

Enhance Scudo test to tolerate GWP-Asan.
Enhance Scudo test to tolerate GWP-Asan.

When LLVM was updated to a new enough release to have GWP-Asan, we
started getting probabilistic test failures, as the double-free would
sometimes be caught by GWP-Asan (odds are about 1/5000).

We should tolerate either output.
