bolt/deps/llvm-18.1.8/llvm/test/Instrumentation/AddressSanitizer/kcfi-offset.ll
2025-02-14 19:21:04 +01:00

15 lines
515 B
LLVM

;; Test that we set patchable-function-prefix for asan.module_ctor when kcfi-offset is defined.
; RUN: opt < %s -passes=asan -S | FileCheck %s
; CHECK: @llvm.global_ctors = {{.*}}{ i32 1, ptr @asan.module_ctor, ptr @asan.module_ctor }
; CHECK: define internal void @asan.module_ctor()
; CHECK-SAME: #[[#ATTR:]]
; CHECK-SAME: !kcfi_type
; CHECK: attributes #[[#ATTR]] = { {{.*}} "patchable-function-prefix"="3" }
!llvm.module.flags = !{!0, !1}
!0 = !{i32 4, !"kcfi", i32 1}
!1 = !{i32 4, !"kcfi-offset", i32 3}