llvm/llvm/test/Instrumentation/RealtimeSanitizer/rtsan_unsafe.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals all --version 5
; RUN: opt < %s -passes=rtsan -S | FileCheck %s

; RealtimeSanitizer pass should create the demangled function name as a global string and,
; at the function entrypoint, pass it as an argument to the rtsan notify method

;.
; CHECK: @[[GLOB0:[0-9]+]] = private unnamed_addr constant [20 x i8] c"blocking_function()\00", align 1
;.
define void @_Z17blocking_functionv() #0 {
; CHECK-LABEL: define void @_Z17blocking_functionv(
; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT:    call void @__rtsan_notify_blocking_call(ptr @[[GLOB0]])
; CHECK-NEXT:    ret void
;
  ret void
}

define noundef i32 @main() #2 {
; CHECK-LABEL: define noundef i32 @main() {
; CHECK-NEXT:    call void @_Z17blocking_functionv()
; CHECK-NEXT:    ret i32 0
;
  call void @_Z17blocking_functionv() #4
  ret i32 0
}

attributes #0 = { mustprogress noinline sanitize_realtime_unsafe optnone ssp uwtable(sync) }
;.
; CHECK: attributes #[[ATTR0]] = { mustprogress noinline optnone sanitize_realtime_unsafe ssp uwtable(sync) }
;.