[llvm] [AArch64][BTI] Add BTI at EH entries. (PR #155308)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 26 10:12:45 PDT 2025
================
@@ -0,0 +1,30 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc -mtriple=aarch64-windows -mattr=+bti -o - %s | FileCheck %s
+
+declare i32 @__CxxFrameHandler3(...)
+declare void @may_throw()
+
+define dso_local void @"?w@@YAXXZ"() #0 personality ptr @__CxxFrameHandler3 {
+entry:
+ invoke void @may_throw()
+ to label %try.cont unwind label %catch.dispatch
+
+catch.dispatch:
+ %cs = catchswitch within none [label %catch] unwind to caller
+
+catch:
+ %cp = catchpad within %cs [ptr null, i32 0, ptr null]
+ call void @may_throw() ["funclet"(token %cp)]
+ catchret from %cp to label %try.cont
+
+try.cont:
+ ret void
+}
+
+attributes #0 = { "branch-target-enforcement"="true" }
+
+; CHECK-LABEL: "?w@@YAXXZ":
----------------
davemgreen wrote:
If you want this test to regenerate too you might need to rename the function from `?w@@YAXXZ` to something else.
https://github.com/llvm/llvm-project/pull/155308
More information about the llvm-commits
mailing list