Files
clang-p2996/llvm/test/Transforms/StackProtector/stack-chk-fail-alias.ll
PiJoules 99e53cb413 [llvm][StackProtector] Add noreturn to __stack_chk_fail call (#143976)
It's possible for __stack_chk_fail to be an alias when using CrossDSOCFI
since it will make a jump table entry for this function and replace it
with an alias. StackProtector can crash since it always expects this to
be a regular function. Instead add the noreturn attribute to the call.
2025-06-16 15:47:43 -07:00

22 lines
619 B
LLVM

;; __stack_chk_fail should have the noreturn attr even if it is an alias
; RUN: opt -mtriple=x86_64-pc-linux-gnu %s -passes=stack-protector -S | FileCheck %s
define hidden void @__stack_chk_fail_impl() {
unreachable
}
@__stack_chk_fail = hidden alias void (), ptr @__stack_chk_fail_impl
; CHECK-LABEL: @store_captures(
; CHECK: CallStackCheckFailBlk:
; CHECK-NEXT: call void @__stack_chk_fail() [[ATTRS:#.*]]
define void @store_captures() sspstrong {
entry:
%a = alloca i32, align 4
%j = alloca ptr, align 8
store ptr %a, ptr %j, align 8
ret void
}
; CHECK: attributes [[ATTRS]] = { noreturn }