llvm-project/llvm/test/CodeGen/ARM/ctors_dtors.ll
Julian Lettner e6a789ef9b Remove -lower-global-dtors-via-cxa-atexit flag
Remove the `-lower-global-dtors-via-cxa-atexit` escape hatch introduced
in D121736 [1], which switched the default lowering of global
destructors on MachO to use `__cxa_atexit()` to avoid emitting
deprecated `__mod_term_func` sections.

I added this flag as an escape hatch in case the switch causes any
problems.  We didn't discover any problems so now we can remove it.

[1] https://reviews.llvm.org/D121736

rdar://90277838

Differential Revision: https://reviews.llvm.org/D145715
2023-03-14 14:18:11 -07:00

28 lines
996 B
LLVM

; RUN: llc < %s -mtriple=arm-apple-darwin | FileCheck %s -check-prefix=DARWIN
; RUN: llc < %s -mtriple=arm-linux-gnu -target-abi=apcs | FileCheck %s -check-prefix=ELF
; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s -check-prefix=GNUEABI
; DARWIN: l_register_call_dtors:
; DARWIN: bl ___cxa_atexit
; DARWIN: .section __DATA,__mod_init_func,mod_init_funcs
; DARWIN-NOT: __mod_term_func
; ELF: .section .ctors,"aw",%progbits
; ELF: .section .dtors,"aw",%progbits
; GNUEABI: .section .init_array,"aw",%init_array
; GNUEABI: .section .fini_array,"aw",%fini_array
@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [ { i32, ptr, ptr } { i32 65535, ptr @__mf_init, ptr null } ] ; <ptr> [#uses=0]
@llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [ { i32, ptr, ptr } { i32 65535, ptr @__mf_fini, ptr null } ] ; <ptr> [#uses=0]
define void @__mf_init() {
entry:
ret void
}
define void @__mf_fini() {
entry:
ret void
}