You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm
bindings
cmake
docs
examples
include
lib
projects
resources
runtimes
scripts
test
Analysis
Assembler
Bindings
Bitcode
BugPoint
CodeGen
AArch64
AMDGPU
ARC
ARM
AVR
BPF
Generic
Hexagon
Inputs
Lanai
MIR
MSP430
Mips
NVPTX
Nios2
PowerPC
RISCV
SPARC
SystemZ
Thumb
Thumb2
WebAssembly
address-offsets.ll
byval.ll
call.ll
cfg-stackify.ll
cfi.ll
comdat.ll
comparisons_f32.ll
comparisons_f64.ll
comparisons_i32.ll
comparisons_i64.ll
conv-trap.ll
conv.ll
copysign-casts.ll
cpus.ll
dbgvalue.ll
dead-vreg.ll
divrem-constant.ll
exception.ll
f16.ll
f32.ll
f64.ll
fast-isel-noreg.ll
fast-isel.ll
frem.ll
func.ll
function-bitcasts-varargs.ll
function-bitcasts.ll
global.ll
globl.ll
i128.ll
i32-load-store-alignment.ll
i32.ll
i64-load-store-alignment.ll
i64.ll
ident.ll
immediates.ll
implicit-def.ll
indirect-import.ll
inline-asm-m.ll
inline-asm.ll
irreducible-cfg.ll
legalize.ll
lit.local.cfg
load-ext-atomic.ll
load-ext.ll
load-store-i1.ll
load.ll
lower-em-ehsjlj-options.ll
lower-em-exceptions-whitelist.ll
lower-em-exceptions.ll
lower-em-sjlj.ll
lower-global-dtors.ll
main-declaration.ll
main.ll
mem-intrinsics.ll
memory-addr32.ll
negative-base-reg.ll
non-executable-stack.ll
offset-atomics.ll
offset-fastisel.ll
offset-folding.ll
offset.ll
phi.ll
reg-stackify.ll
return-int32.ll
return-void.ll
returned.ll
select.ll
signext-arg.ll
signext-inreg.ll
signext-zeroext.ll
simd-arith.ll
stack-alignment.ll
store-trunc.ll
store.ll
switch.ll
umulo-i64.ll
unreachable.ll
unsupported-function-bitcasts.ll
unused-argument.ll
userstack.ll
varargs.ll
vtable.ll
WinEH
X86
XCore
DebugInfo
Examples
ExecutionEngine
Feature
FileCheck
Instrumentation
Integer
JitListener
LTO
Linker
MC
Object
ObjectYAML
Other
SafepointIRVerifier
SymbolRewriter
TableGen
ThinLTO
Transforms
Unit
Verifier
YAMLParser
tools
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg.py
lit.site.cfg.py.in
tools
unittests
utils
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
libgc
llvm
m4
man
mcs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
140 lines
5.0 KiB
LLVM
140 lines
5.0 KiB
LLVM
![]() |
; RUN: llc < %s -asm-verbose=false | FileCheck --check-prefix=CHECK --check-prefix=FINI --check-prefix=NULL %s
|
||
|
|
||
|
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
|
||
|
target triple = "wasm32-unknown-unknown-wasm"
|
||
|
|
||
|
; Test that @llvm.global_dtors is properly lowered into @llvm.global_ctors,
|
||
|
; grouping dtor calls by priority and associated symbol.
|
||
|
|
||
|
declare void @orig_ctor()
|
||
|
declare void @orig_dtor0()
|
||
|
declare void @orig_dtor1a()
|
||
|
declare void @orig_dtor1b()
|
||
|
declare void @orig_dtor1c0()
|
||
|
declare void @orig_dtor1c1a()
|
||
|
declare void @orig_dtor1c1b()
|
||
|
declare void @orig_dtor65536()
|
||
|
declare void @after_the_null()
|
||
|
|
||
|
@associated1c0 = external global i8
|
||
|
@associated1c1 = external global i8
|
||
|
|
||
|
@llvm.global_ctors = appending global
|
||
|
[1 x { i32, void ()*, i8* }]
|
||
|
[
|
||
|
{ i32, void ()*, i8* } { i32 200, void ()* @orig_ctor, i8* null }
|
||
|
]
|
||
|
|
||
|
@llvm.global_dtors = appending global
|
||
|
[9 x { i32, void ()*, i8* }]
|
||
|
[
|
||
|
{ i32, void ()*, i8* } { i32 0, void ()* @orig_dtor0, i8* null },
|
||
|
{ i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1a, i8* null },
|
||
|
{ i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1b, i8* null },
|
||
|
{ i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c0, i8* @associated1c0 },
|
||
|
{ i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c1a, i8* @associated1c1 },
|
||
|
{ i32, void ()*, i8* } { i32 1, void ()* @orig_dtor1c1b, i8* @associated1c1 },
|
||
|
{ i32, void ()*, i8* } { i32 65535, void ()* @orig_dtor65536, i8* null },
|
||
|
{ i32, void ()*, i8* } { i32 65535, void ()* null, i8* null },
|
||
|
{ i32, void ()*, i8* } { i32 65535, void ()* @after_the_null, i8* null }
|
||
|
]
|
||
|
|
||
|
; CHECK-LABEL: .Lcall_dtors.0:
|
||
|
; CHECK-NEXT: .param i32{{$}}
|
||
|
; CHECK-NEXT: call orig_dtor0@FUNCTION{{$}}
|
||
|
|
||
|
; CHECK-LABEL: .Lregister_call_dtors.0:
|
||
|
; CHECK-NEXT: block
|
||
|
; CHECK-NEXT: i32.const $push2=, .Lcall_dtors.0@FUNCTION{{$}}
|
||
|
; CHECK-NEXT: i32.const $push1=, 0
|
||
|
; CHECK-NEXT: i32.const $push0=, __dso_handle
|
||
|
; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}}
|
||
|
; CHECK-NEXT: br_if 0, $pop3
|
||
|
; CHECK-NEXT: return
|
||
|
; CHECK: end_block
|
||
|
; CHECK-NEXT: unreachable
|
||
|
|
||
|
; CHECK-LABEL: .Lcall_dtors.1:
|
||
|
; CHECK-NEXT: .param i32{{$}}
|
||
|
; CHECK-NEXT: call orig_dtor1a@FUNCTION{{$}}
|
||
|
; CHECK-NEXT: call orig_dtor1b@FUNCTION{{$}}
|
||
|
|
||
|
; CHECK-LABEL: .Lregister_call_dtors.1:
|
||
|
; CHECK-NEXT: block
|
||
|
; CHECK-NEXT: i32.const $push2=, .Lcall_dtors.1@FUNCTION{{$}}
|
||
|
; CHECK-NEXT: i32.const $push1=, 0
|
||
|
; CHECK-NEXT: i32.const $push0=, __dso_handle
|
||
|
; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}}
|
||
|
; CHECK-NEXT: br_if 0, $pop3
|
||
|
; CHECK-NEXT: return
|
||
|
; CHECK: end_block
|
||
|
; CHECK-NEXT: unreachable
|
||
|
|
||
|
; CHECK-LABEL: .Lcall_dtors.1.associated1c0:
|
||
|
; CHECK-NEXT: .param i32{{$}}
|
||
|
; CHECK-NEXT: call orig_dtor1c0@FUNCTION{{$}}
|
||
|
|
||
|
; CHECK-LABEL: .Lregister_call_dtors.1.associated1c0:
|
||
|
; CHECK-NEXT: block
|
||
|
; CHECK-NEXT: i32.const $push2=, .Lcall_dtors.1.associated1c0@FUNCTION{{$}}
|
||
|
; CHECK-NEXT: i32.const $push1=, 0
|
||
|
; CHECK-NEXT: i32.const $push0=, __dso_handle
|
||
|
; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}}
|
||
|
; CHECK-NEXT: br_if 0, $pop3
|
||
|
; CHECK-NEXT: return
|
||
|
; CHECK: end_block
|
||
|
; CHECK-NEXT: unreachable
|
||
|
|
||
|
; CHECK-LABEL: .Lcall_dtors.1.associated1c1:
|
||
|
; CHECK-NEXT: .param i32{{$}}
|
||
|
; CHECK-NEXT: call orig_dtor1c1a@FUNCTION{{$}}
|
||
|
; CHECK-NEXT: call orig_dtor1c1b@FUNCTION{{$}}
|
||
|
|
||
|
; CHECK-LABEL: .Lregister_call_dtors.1.associated1c1:
|
||
|
; CHECK-NEXT: block
|
||
|
; CHECK-NEXT: i32.const $push2=, .Lcall_dtors.1.associated1c1@FUNCTION{{$}}
|
||
|
; CHECK-NEXT: i32.const $push1=, 0
|
||
|
; CHECK-NEXT: i32.const $push0=, __dso_handle
|
||
|
; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}}
|
||
|
; CHECK-NEXT: br_if 0, $pop3
|
||
|
; CHECK-NEXT: return
|
||
|
; CHECK: end_block
|
||
|
; CHECK-NEXT: unreachable
|
||
|
|
||
|
; CHECK-LABEL: .Lcall_dtors:
|
||
|
; CHECK-NEXT: .param i32{{$}}
|
||
|
; CHECK-NEXT: call orig_dtor65536@FUNCTION{{$}}
|
||
|
|
||
|
; CHECK-LABEL: .Lregister_call_dtors:
|
||
|
; CHECK-NEXT: block
|
||
|
; CHECK-NEXT: i32.const $push2=, .Lcall_dtors@FUNCTION{{$}}
|
||
|
; CHECK-NEXT: i32.const $push1=, 0
|
||
|
; CHECK-NEXT: i32.const $push0=, __dso_handle
|
||
|
; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}}
|
||
|
; CHECK-NEXT: br_if 0, $pop3
|
||
|
; CHECK-NEXT: return
|
||
|
; CHECK: end_block
|
||
|
; CHECK-NEXT: unreachable
|
||
|
|
||
|
; CHECK-LABEL: .section .init_array.0,"",@
|
||
|
; CHECK: .int32 .Lregister_call_dtors.0@FUNCTION{{$}}
|
||
|
; CHECK-LABEL: .section .init_array.1,"",@
|
||
|
; CHECK: .int32 .Lregister_call_dtors.1@FUNCTION{{$}}
|
||
|
; CHECK-LABEL: .section .init_array.200,"",@
|
||
|
; CHECK: .int32 orig_ctor@FUNCTION{{$}}
|
||
|
; CHECK-LABEL: .section .init_array,"",@
|
||
|
; CHECK: .int32 .Lregister_call_dtors@FUNCTION{{$}}
|
||
|
|
||
|
; CHECK-LABEL: .weak __dso_handle
|
||
|
|
||
|
; CHECK-LABEL: .functype __cxa_atexit, i32, i32, i32, i32{{$}}
|
||
|
|
||
|
; We shouldn't make use of a .fini_array section.
|
||
|
|
||
|
; FINI-NOT: fini_array
|
||
|
|
||
|
; This function is listed after the null terminator, so it should
|
||
|
; be excluded.
|
||
|
|
||
|
; NULL-NOT: after_the_null
|