Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / gwp_asan / invalid_free_left.cpp
blobcb259f2431389077f2d1587a5ffba9a6a49ef6ee
1 // REQUIRES: gwp_asan
2 // RUN: %clangxx_gwp_asan %s -o %t
3 // RUN: %expect_crash %run %t 2>&1 | FileCheck %s
5 // CHECK: GWP-ASan detected a memory error
6 // CHECK: Invalid (Wild) Free at 0x{{[a-f0-9]+}} (1 byte to the left of a
7 // CHECK-SAME: 1-byte allocation
9 #include <cstdlib>
11 int main() {
12 char *Ptr =
13 reinterpret_cast<char *>(malloc(1));
14 free(Ptr - 1);
15 return 0;