File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 5
5
// Intent: Ensure that an intercepted call in a [[clang::nonblocking]] function
6
6
// is flagged as an error. Basic smoke test.
7
7
8
+ #include < stdio.h>
8
9
#include < stdlib.h>
9
10
10
- void violation () [[clang::nonblocking]] { void *Ptr = malloc (2 ); }
11
+ void violation () [[clang::nonblocking]] {
12
+ void *ptr = malloc (2 );
13
+ printf (" ptr: %p\n " , ptr); // ensure we don't optimize out the malloc
14
+ }
11
15
12
16
int main () {
13
17
violation ();
Original file line number Diff line number Diff line change 9
9
10
10
// In this test, we don't use the -fsanitize=realtime flag, so nothing
11
11
// should happen here
12
- void violation () [[clang::nonblocking]] { void *Ptr = malloc (2 ); }
12
+ void violation () [[clang::nonblocking]] {
13
+ void *ptr = malloc (2 );
14
+ printf (" ptr: %p\n " , ptr); // ensure we don't optimize out the malloc
15
+ }
13
16
14
17
int main () {
15
18
printf (" Starting run\n " );
You can’t perform that action at this time.
0 commit comments