xref: /llvm-project/llvm/test/Instrumentation/AddressSanitizer/kcfi-offset.ll (revision fd5e2627066075f3d15ef774ef368e08735a9ac9)
1;; Test that we set patchable-function-prefix for asan.module_ctor when kcfi-offset is defined.
2
3; RUN: opt < %s -passes=asan -S | FileCheck %s
4
5; CHECK: @llvm.global_ctors = {{.*}}{ i32 1, ptr @asan.module_ctor, ptr @asan.module_ctor }
6
7; CHECK: define internal void @asan.module_ctor()
8; CHECK-SAME: #[[#ATTR:]]
9; CHECK-SAME: !kcfi_type
10
11; CHECK: attributes #[[#ATTR]] = { {{.*}} "patchable-function-prefix"="3" }
12
13!llvm.module.flags = !{!0, !1}
14!0 = !{i32 4, !"kcfi", i32 1}
15!1 = !{i32 4, !"kcfi-offset", i32 3}
16