[llvm] [AArch64][BTI] Add BTI at EH entries. (PR #155308)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 26 00:01:05 PDT 2025


================
@@ -0,0 +1,29 @@
+; REQUIRES: aarch64-registered-target
+; RUN: llc -mtriple=aarch64-unknown-linux-gnu %s -o - | FileCheck %s
+
+target triple = "aarch64-unknown-linux-gnu"
+
+declare i32 @__gxx_personality_v0(...)
+declare void @may_throw()
+
+define void @test() #0 personality ptr @__gxx_personality_v0 {
+entry:
+  invoke void @may_throw()
+          to label %ret unwind label %lpad
+
+lpad:
+  landingpad { ptr, i32 } cleanup
+  ret void
+
+ret:
+  ret void
+}
+
+; Request BTI in codegen.
+attributes #0 = { "branch-target-enforcement"="true" "target-features"="+bti" }
+
+; CHECK-LABEL: test:
----------------
davemgreen wrote:

Run update_llc_test_checks.py on the file. We should test the whole thing.

It should work on both the new test files providing that the function name can be matched.

https://github.com/llvm/llvm-project/pull/155308


More information about the llvm-commits mailing list