repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git]
/
compiler-rt
/
test
/
gwp_asan
/
double_free.cpp
blob
c72426c6edb03e549b6c4ff974f1f9bbb312dddf
1
// REQUIRES: gwp_asan
2
// RUN: %clangxx_gwp_asan %s -o %t
3
// RUN: %expect_crash %run %t 2>&1 | FileCheck %s
4
5
#include <cstdlib>
6
7
int
main
() {
8
// CHECK: GWP-ASan detected a memory error
9
// CHECK: Double Free at 0x{{[a-f0-9]+}} (a 10-byte allocation)
10
void
*
Ptr
=
malloc
(
10
);
11
12
free
(
Ptr
);
13
free
(
Ptr
);
14
return
0
;
15
}