Skip to content

Commit 04fde07

Browse files
committed
[rtsan][compiler-rt] Get rid of [[blocking]] stub in tests
1 parent 91fdfec commit 04fde07

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

compiler-rt/test/rtsan/blocking_call.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,11 @@
77
#include <stdio.h>
88
#include <stdlib.h>
99

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");
1612
}
1713

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"); }
2215

2316
void process() [[clang::nonblocking]] { custom_blocking_function(); }
2417

@@ -28,7 +21,7 @@ int main() {
2821
return 0;
2922
// CHECK-NOT: {{.*safe_call*}}
3023
// 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!
3225
// CHECK-NEXT: {{.*custom_blocking_function*}}
3326
// CHECK-NEXT: {{.*process*}}
3427
}

0 commit comments

Comments
 (0)