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
/
tsan
/
Darwin
/
realloc-zero.cpp
blob
98262463cb2d1d09f650a9c40eda643b5bdfb26d
1
// Test that realloc(nullptr, 0) return a non-NULL pointer.
2
3
// RUN: %clang_tsan %s -o %t
4
// RUN: %run %t 2>&1 | FileCheck %s
5
6
#include <malloc/malloc.h>
7
#include <stdio.h>
8
#include <stdlib.h>
9
#include <sys/mman.h>
10
11
int
main
() {
12
void
*
p
=
realloc
(
NULL
,
0
);
13
if
(!
p
) {
14
abort
();
15
}
16
fprintf
(
stderr
,
"Okay.
\n
"
);
17
return
0
;
18
}
19
20
// CHECK: Okay.