llvm-project/llvm/test/Bitcode/upgrade-branch-protection.ll
Daniel Kiss b0343a38a5 Support the min of module flags when linking, use for AArch64 BTI/PAC-RET
LTO objects might compiled with different `mbranch-protection` flags which will cause an error in the linker.
Such a setup is allowed in the normal build with this change that is possible.

Reviewed By: pcc

Differential Revision: https://reviews.llvm.org/D123493
2022-04-13 09:31:51 +02:00

16 lines
660 B
LLVM

;; Test that module flags "branch-target-enforcement" and "sign-return-address" can be upgraded to
;; are upgraded from Error to Min.
; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s
!llvm.module.flags = !{!0, !1, !2, !3}
!0 = !{i32 1, !"branch-target-enforcement", i32 1}
!1 = !{i32 1, !"sign-return-address", i32 1}
!2 = !{i32 1, !"sign-return-address-all", i32 1}
!3 = !{i32 1, !"sign-return-address-with-bkey", i32 1}
;CHECK: !0 = !{i32 8, !"branch-target-enforcement", i32 1}
;CHECK: !1 = !{i32 8, !"sign-return-address", i32 1}
;CHECK: !2 = !{i32 8, !"sign-return-address-all", i32 1}
;CHECK: !3 = !{i32 8, !"sign-return-address-with-bkey", i32 1}