llvm-project/llvm/test/CodeGen/X86/func-sanitizer.ll
Leonard Grey c23135c548
-fsanitize=function: fix .subsections_via_symbols (#87527)
-fsanitize=function emits a signature and function hash before a
function. Similar to 7f6e2c9, these can be sheared off when
`.subsections_via_symbols` is used.

This change uses the same technique 7f6e2c9 introduced for prefixes:
emitting a symbol for the metadata, then marking the actual function
entry as an .alt_entry symbol.
2024-04-08 16:05:52 -04:00

26 lines
693 B
LLVM

; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s --check-prefix=MACHO
; CHECK: .type _Z3funv,@function
; CHECK-NEXT: .long 3238382334 # 0xc105cafe
; CHECK-NEXT: .long 42
; CHECK-NEXT: _Z3funv:
; CHECK-NEXT: .cfi_startproc
; CHECK-NEXT: # %bb.0:
; CHECK-NEXT: retq
; MACHO: ltmp0:
; MACHO-NEXT: .long 3238382334 ## 0xc105cafe
; MACHO-NEXT: .long 42 ## 0x2a
; MACHO-NEXT: .alt_entry __Z3funv
; MACHO-NEXT: __Z3funv:
; MACHO-NEXT: .cfi_startproc
; MACHO-NEXT: # %bb.0:
; MACHO-NEXT: retq
define dso_local void @_Z3funv() !func_sanitize !0 {
ret void
}
!0 = !{i32 3238382334, i32 42}