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
Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git]
/
compiler-rt
/
test
/
asan
/
TestCases
/
on_error_callback.cpp
blob
c38a36f0e33bdaf50b01311df0f62a0c4130daba
1
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
2
3
#include <stdio.h>
4
#include <stdlib.h>
5
6
// Required for dyld macOS 12.0+
7
#if (__APPLE__)
8
__attribute__
((
weak
))
9
#endif
10
extern
"C"
void
11
__asan_on_error
() {
12
fprintf
(
stderr
,
"__asan_on_error called
\n
"
);
13
fflush
(
stderr
);
14
}
15
16
int
main
() {
17
char
*
x
= (
char
*)
malloc
(
10
*
sizeof
(
char
));
18
free
(
x
);
19
return
x
[
5
];
20
// CHECK: __asan_on_error called
21
}