xref: /llvm-project/llvm/test/CodeGen/ARM/ctors_dtors.ll (revision c3f0153ec27a5e2cff97179d319ab99651c4c539)
1; RUN: llc < %s -mtriple=arm-apple-darwin  | FileCheck %s -check-prefix=DARWIN
2; RUN: llc < %s -mtriple=arm-apple-darwin -disable-atexit-based-global-dtor-lowering  | FileCheck %s -check-prefix=DARWIN-LEGACY
3; RUN: llc < %s -mtriple=arm-linux-gnu -target-abi=apcs  | FileCheck %s -check-prefix=ELF
4; RUN: llc < %s -mtriple=arm-linux-gnueabi | FileCheck %s -check-prefix=GNUEABI
5
6; DARWIN: l_register_call_dtors:
7; DARWIN: bl	___cxa_atexit
8; DARWIN: .section	__DATA,__mod_init_func,mod_init_funcs
9; DARWIN-NOT: __mod_term_func
10
11; DARWIN-LEGACY-NOT: atexit
12; DARWIN-LEGACY: .section	__DATA,__mod_init_func,mod_init_funcs
13; DARWIN-LEGACY: .section	__DATA,__mod_term_func,mod_term_funcs
14
15; ELF: .section .ctors,"aw",%progbits
16; ELF: .section .dtors,"aw",%progbits
17
18; GNUEABI: .section .init_array,"aw",%init_array
19; GNUEABI: .section .fini_array,"aw",%fini_array
20
21@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [ { i32, ptr, ptr } { i32 65535, ptr @__mf_init, ptr null } ]                ; <ptr> [#uses=0]
22@llvm.global_dtors = appending global [1 x { i32, ptr, ptr }] [ { i32, ptr, ptr } { i32 65535, ptr @__mf_fini, ptr null } ]                ; <ptr> [#uses=0]
23
24define void @__mf_init() {
25entry:
26        ret void
27}
28
29define void @__mf_fini() {
30entry:
31        ret void
32}
33