File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change 7
7
#include < stdio.h>
8
8
#include < stdlib.h>
9
9
10
- // TODO: Remove when [[blocking]] is implemented.
11
- extern " C" void __rtsan_notify_blocking_call (const char *function_name);
12
-
13
- void custom_blocking_function () {
14
- // TODO: When [[blocking]] is implemented, don't call this directly.
15
- __rtsan_notify_blocking_call (__func__);
10
+ void custom_blocking_function () [[clang::blocking]] {
11
+ printf (" In blocking function\n " );
16
12
}
17
13
18
- void safe_call () {
19
- // TODO: When [[blocking]] is implemented, don't call this directly.
20
- __rtsan_notify_blocking_call (__func__);
21
- }
14
+ void safe_call () [[clang::blocking]] { printf (" In safe call\n " ); }
22
15
23
16
void process () [[clang::nonblocking]] { custom_blocking_function (); }
24
17
@@ -28,7 +21,7 @@ int main() {
28
21
return 0 ;
29
22
// CHECK-NOT: {{.*safe_call*}}
30
23
// CHECK: ==ERROR: RealtimeSanitizer: blocking-call
31
- // CHECK-NEXT: Call to blocking function `custom_blocking_function` in real-time context!
24
+ // CHECK-NEXT: Call to blocking function `custom_blocking_function() ` in real-time context!
32
25
// CHECK-NEXT: {{.*custom_blocking_function*}}
33
26
// CHECK-NEXT: {{.*process*}}
34
27
}
You can’t perform that action at this time.
0 commit comments