Skip to content

Commit e8bc15b

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

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

compiler-rt/test/rtsan/blocking_call.cpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,26 @@
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

2518
int main() {
2619
safe_call(); // This shouldn't die, because it isn't in nonblocking context.
2720
process();
2821
return 0;
29-
// CHECK-NOT: {{.*safe_call*}}
3022
// CHECK: ==ERROR: RealtimeSanitizer: blocking-call
31-
// CHECK-NEXT: Call to blocking function `custom_blocking_function` in real-time context!
23+
// CHECK-NEXT: Call to blocking function `custom_blocking_function()` in real-time context!
3224
// CHECK-NEXT: {{.*custom_blocking_function*}}
3325
// CHECK-NEXT: {{.*process*}}
26+
27+
// We should crash before this line is printed
28+
// CHECK-NOT: {{.*In blocking function.*}}
29+
30+
// should only occur once
31+
// CHECK-NOT: ==ERROR: RealtimeSanitizer: blocking-call
3432
}

0 commit comments

Comments
 (0)