41 lines · plain
1;; Testcase to check that module with different branch-target-enforcement can2;; be mixed.3;;4; RUN: llvm-as %s -o %t1.bc5; RUN: llvm-as %p/Inputs/foo.ll -o %t2.bc6; RUN: llvm-lto -exported-symbol main \7; RUN: -exported-symbol foo_on \8; RUN: -filetype=obj \9; RUN: %t1.bc %t2.bc \10; RUN: -o %t1.exe 2>&1 | FileCheck --allow-empty %s11; RUN: llvm-objdump -d %t1.exe | FileCheck --check-prefix=CHECK-DUMP %s12; RUN: llvm-readelf -n %t1.exe | FileCheck --check-prefix=CHECK-PROP %s13 14target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"15target triple = "aarch64-unknown-linux-gnu"16 17declare i32 @foo_on();18 19define i32 @main() "sign-return-address"="non-leaf" "sign-return-address-key"="a_key" {20entry:21 %add = call i32 @foo_on()22 ret i32 %add23}24 25!llvm.module.flags = !{!0, !1, !2, !3 }26!0 = !{i32 8, !"branch-target-enforcement", i32 0}27!1 = !{i32 8, !"sign-return-address", i32 1}28!2 = !{i32 8, !"sign-return-address-all", i32 0}29!3 = !{i32 8, !"sign-return-address-with-bkey", i32 0}30 31; CHECK-NOT: linking module flags 'branch-target-enforcement': IDs have conflicting values in32; CHECK-DUMP: <main>:33; CHECK-DUMP: paciasp34; CHECK-DUMP: str35; CHECK-DUMP: bl 0x8 <main+0x8>36; CHECK-DUMP: <foo_on>:37; CHECK-DUMP: pacibsp38 39;; `main` doesn't support BTI while `foo` does, so in the binary40;; we should see only PAC which is supported by both.41; CHECK-PROP: Properties: aarch64 feature: PAC