1 ;; Verify that the synthetic functions inherit their flags from the corresponding
2 ;; BTE and return address signing module flags.
3 ; RUN: opt < %s -passes=asan -S | FileCheck %s
4 ; REQUIRES: aarch64-registered-target
6 target triple = "aarch64-unknown-linux-gnu"
8 @g = dso_local global i32 0, align 4
10 define i32 @test_load() sanitize_memory {
12 %tmp = load i32, ptr @g, align 4
16 !llvm.module.flags = !{!0, !1}
18 ;; Due to -fasynchronous-unwind-tables.
19 !0 = !{i32 7, !"uwtable", i32 2}
21 ;; Due to -fno-omit-frame-pointer.
22 !1 = !{i32 7, !"frame-pointer", i32 2}
24 !llvm.module.flags = !{!2, !3, !4}
26 !2 = !{i32 8, !"branch-target-enforcement", i32 1}
27 !3 = !{i32 8, !"sign-return-address", i32 1}
28 !4 = !{i32 8, !"sign-return-address-all", i32 0}
30 ;; Set the uwtable attribute on ctor/dtor.
31 ; CHECK: define internal void @asan.module_ctor() #[[#ATTR:]]
32 ; CHECK: define internal void @asan.module_dtor() #[[#ATTR]]
33 ; CHECK: attributes #[[#ATTR]] = { nounwind uwtable "branch-target-enforcement" "frame-pointer"="all" "sign-return-address"="non-leaf" "sign-return-address-key"="a_key" }