-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demangle [[clang::blocking]] function names in rtsan pass
- Loading branch information
1 parent
f4c722c
commit b354df2
Showing
2 changed files
with
10 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 8 additions & 5 deletions
13
llvm/test/Instrumentation/RealtimeSanitizer/rtsan_unsafe.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
; RUN: opt < %s -passes=rtsan -S | FileCheck %s | ||
|
||
define void @blocking_function() #0 { | ||
define void @_Z17blocking_functionv() #0 { | ||
ret void | ||
} | ||
|
||
define noundef i32 @main() #2 { | ||
call void @blocking_function() #4 | ||
call void @_Z17blocking_functionv() #4 | ||
ret i32 0 | ||
} | ||
|
||
attributes #0 = { mustprogress noinline sanitize_realtime_unsafe optnone ssp uwtable(sync) } | ||
|
||
; RealtimeSanitizer pass should insert __rtsan_expect_not_realtime at function entrypoint | ||
; CHECK-LABEL: @blocking_function() | ||
; CHECK-NEXT: call{{.*}}@__rtsan_expect_not_realtime({{ptr .*}}) | ||
; RealtimeSanitizer pass should create the demangled function name as a global string, and | ||
; pass it as input to an inserted __rtsan_expect_not_realtime call at the function entrypoint | ||
; CHECK: [[GLOBAL_STR:@[a-zA-Z0-9\.]+]] | ||
; CHECK-SAME: c"blocking_function()\00" | ||
; CHECK-LABEL: @_Z17blocking_functionv() | ||
; CHECK-NEXT: call{{.*}}@__rtsan_expect_not_realtime(ptr{{.*}}[[GLOBAL_STR]]) |