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
/
asan
/
TestCases
/
frexp_interceptor.cpp
blob
d75ba992b650b5b9f98115dff4d569941babb3b4
1
// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2
3
// Test the frexp() interceptor.
4
5
#include <math.h>
6
#include <stdio.h>
7
#include <stdlib.h>
8
int
main
() {
9
double
x
=
3.14
;
10
int
*
exp
= (
int
*)
malloc
(
sizeof
(
int
));
11
free
(
exp
);
12
double
y
=
frexp
(
x
,
exp
);
13
// CHECK: use-after-free
14
// CHECK: SUMMARY
15
return
0
;
16
}