[llvm] [CodeGen] Generalize trap emission after SP check fail (PR #109744)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 11 10:56:18 PDT 2024
================
@@ -0,0 +1,36 @@
+; NOTE: Do not autogenerate, we'd lose the .Lfunc_end0 -NEXT checks otherwise.
+;; Make sure we emit trap instructions after stack protector checks iff NoTrapAfterNoReturn is false.
+
+; RUN: llc -mtriple=aarch64 -fast-isel=false -global-isel=false -verify-machineinstrs \
+; RUN: -trap-unreachable=false -o - %s | FileCheck --check-prefix=NO_TRAP_UNREACHABLE %s
+; RUN: llc -mtriple=aarch64 -fast-isel=false -global-isel=false -verify-machineinstrs \
+; RUN: -trap-unreachable -no-trap-after-noreturn -o - %s | FileCheck --check-prefix=NO_TRAP_UNREACHABLE %s
+; RUN: llc -mtriple=aarch64 -fast-isel=false -global-isel=false -verify-machineinstrs \
+; RUN: -trap-unreachable -no-trap-after-noreturn=false -o - %s | FileCheck --check-prefix=TRAP_UNREACHABLE %s
+
+;; Make sure FastISel doesn't break anything.
+; RUN: llc -mtriple=aarch64 -fast-isel -verify-machineinstrs \
+; RUN: -trap-unreachable=false -o - %s | FileCheck --check-prefix=NO_TRAP_UNREACHABLE %s
+; RUN: llc -mtriple=aarch64 -fast-isel -verify-machineinstrs \
+; RUN: -trap-unreachable -no-trap-after-noreturn -o - %s | FileCheck --check-prefix=NO_TRAP_UNREACHABLE %s
+; RUN: llc -mtriple=aarch64 -fast-isel -verify-machineinstrs \
+; RUN: -trap-unreachable -no-trap-after-noreturn=false -o - %s | FileCheck --check-prefix=TRAP_UNREACHABLE %s
+
+define void @test() nounwind ssp {
----------------
kr367162 wrote:
Done - this also lets us autogenerate one of the tests.
https://github.com/llvm/llvm-project/pull/109744
More information about the llvm-commits
mailing list