Files
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
libcxx
libcxxabi
libunwind
lld
lldb
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
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mk
mono
msvc
netcore
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
Xamarin Public Jenkins (auto-signing) 468663ddbb Imported Upstream version 6.10.0.49
Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
2020-01-16 16:38:04 +00:00

175 lines
6.7 KiB
LLVM

; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s --check-prefix=TYPEINFONAME
; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s --check-prefix=VTABLE
; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s --check-prefix=TYPEINFO
; Test that simple vtables assemble as expected.
;
; The class hierarchy is:
; struct A;
; struct B : public A;
; struct C : public A;
; struct D : public B;
; Each with a virtual dtor and method foo.
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
target triple = "wasm32-unknown-unknown-wasm"
%struct.A = type { i32 (...)** }
%struct.B = type { %struct.A }
%struct.C = type { %struct.A }
%struct.D = type { %struct.B }
@_ZTVN10__cxxabiv117__class_type_infoE = external global i8*
@_ZTVN10__cxxabiv120__si_class_type_infoE = external global i8*
; TYPEINFONAME-LABEL: _ZTS1A:
; TYPEINFONAME-NEXT: .asciz "1A"
@_ZTS1A = constant [3 x i8] c"1A\00"
; TYPEINFONAME-LABEL: _ZTS1B:
; TYPEINFONAME-NEXT: .asciz "1B"
@_ZTS1B = constant [3 x i8] c"1B\00"
; TYPEINFONAME-LABEL: _ZTS1C:
; TYPEINFONAME-NEXT: .asciz "1C"
@_ZTS1C = constant [3 x i8] c"1C\00"
; TYPEINFONAME-LABEL: _ZTS1D:
; TYPEINFONAME-NEXT: .asciz "1D"
@_ZTS1D = constant [3 x i8] c"1D\00"
; VTABLE: .type _ZTV1A,@object
; VTABLE-NEXT: .section .data.rel.ro._ZTV1A,
; VTABLE-NEXT: .globl _ZTV1A
; VTABLE-LABEL: _ZTV1A:
; VTABLE-NEXT: .int32 0
; VTABLE-NEXT: .int32 _ZTI1A
; VTABLE-NEXT: .int32 _ZN1AD2Ev
; VTABLE-NEXT: .int32 _ZN1AD0Ev
; VTABLE-NEXT: .int32 _ZN1A3fooEv
; VTABLE-NEXT: .size _ZTV1A, 20
@_ZTV1A = constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*), i8* bitcast (%struct.A* (%struct.A*)* @_ZN1AD2Ev to i8*), i8* bitcast (void (%struct.A*)* @_ZN1AD0Ev to i8*), i8* bitcast (void (%struct.A*)* @_ZN1A3fooEv to i8*)], align 4
; VTABLE: .type _ZTV1B,@object
; VTABLE-NEXT: .section .data.rel.ro._ZTV1B,
; VTABLE-NEXT: .globl _ZTV1B
; VTABLE-LABEL: _ZTV1B:
; VTABLE-NEXT: .int32 0
; VTABLE-NEXT: .int32 _ZTI1B
; VTABLE-NEXT: .int32 _ZN1AD2Ev
; VTABLE-NEXT: .int32 _ZN1BD0Ev
; VTABLE-NEXT: .int32 _ZN1B3fooEv
; VTABLE-NEXT: .size _ZTV1B, 20
@_ZTV1B = constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1B to i8*), i8* bitcast (%struct.A* (%struct.A*)* @_ZN1AD2Ev to i8*), i8* bitcast (void (%struct.B*)* @_ZN1BD0Ev to i8*), i8* bitcast (void (%struct.B*)* @_ZN1B3fooEv to i8*)], align 4
; VTABLE: .type _ZTV1C,@object
; VTABLE-NEXT: .section .data.rel.ro._ZTV1C,
; VTABLE-NEXT: .globl _ZTV1C
; VTABLE-LABEL: _ZTV1C:
; VTABLE-NEXT: .int32 0
; VTABLE-NEXT: .int32 _ZTI1C
; VTABLE-NEXT: .int32 _ZN1AD2Ev
; VTABLE-NEXT: .int32 _ZN1CD0Ev
; VTABLE-NEXT: .int32 _ZN1C3fooEv
; VTABLE-NEXT: .size _ZTV1C, 20
@_ZTV1C = constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1C to i8*), i8* bitcast (%struct.A* (%struct.A*)* @_ZN1AD2Ev to i8*), i8* bitcast (void (%struct.C*)* @_ZN1CD0Ev to i8*), i8* bitcast (void (%struct.C*)* @_ZN1C3fooEv to i8*)], align 4
; VTABLE: .type _ZTV1D,@object
; VTABLE-NEXT: .section .data.rel.ro._ZTV1D,
; VTABLE-NEXT: .globl _ZTV1D
; VTABLE-LABEL: _ZTV1D:
; VTABLE-NEXT: .int32 0
; VTABLE-NEXT: .int32 _ZTI1D
; VTABLE-NEXT: .int32 _ZN1AD2Ev
; VTABLE-NEXT: .int32 _ZN1DD0Ev
; VTABLE-NEXT: .int32 _ZN1D3fooEv
; VTABLE-NEXT: .size _ZTV1D, 20
@_ZTV1D = constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1D to i8*), i8* bitcast (%struct.A* (%struct.A*)* @_ZN1AD2Ev to i8*), i8* bitcast (void (%struct.D*)* @_ZN1DD0Ev to i8*), i8* bitcast (void (%struct.D*)* @_ZN1D3fooEv to i8*)], align 4
; TYPEINFO: .type _ZTI1A,@object
; TYPEINFO: .globl _ZTI1A
; TYPEINFO-LABEL: _ZTI1A:
; TYPEINFO-NEXT: .int32 _ZTVN10__cxxabiv117__class_type_infoE+8
; TYPEINFO-NEXT: .int32 _ZTS1A
; TYPEINFO-NEXT: .size _ZTI1A, 8
@_ZTI1A = constant { i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv117__class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1A, i32 0, i32 0) }
; TYPEINFO: .type _ZTI1B,@object
; TYPEINFO: .globl _ZTI1B
; TYPEINFO-LABEL: _ZTI1B:
; TYPEINFO-NEXT: .int32 _ZTVN10__cxxabiv120__si_class_type_infoE+8
; TYPEINFO-NEXT: .int32 _ZTS1B
; TYPEINFO-NEXT: .int32 _ZTI1A
; TYPEINFO-NEXT: .size _ZTI1B, 12
@_ZTI1B = constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1B, i32 0, i32 0), i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*) }
; TYPEINFO: .type _ZTI1C,@object
; TYPEINFO: .globl _ZTI1C
; TYPEINFO-LABEL: _ZTI1C:
; TYPEINFO-NEXT: .int32 _ZTVN10__cxxabiv120__si_class_type_infoE+8
; TYPEINFO-NEXT: .int32 _ZTS1C
; TYPEINFO-NEXT: .int32 _ZTI1A
; TYPEINFO-NEXT: .size _ZTI1C, 12
@_ZTI1C = constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1C, i32 0, i32 0), i8* bitcast ({ i8*, i8* }* @_ZTI1A to i8*) }
; TYPEINFO: .type _ZTI1D,@object
; TYPEINFO: .globl _ZTI1D
; TYPEINFO-LABEL: _ZTI1D:
; TYPEINFO-NEXT: .int32 _ZTVN10__cxxabiv120__si_class_type_infoE+8
; TYPEINFO-NEXT: .int32 _ZTS1D
; TYPEINFO-NEXT: .int32 _ZTI1B
; TYPEINFO-NEXT: .size _ZTI1D, 12
@_ZTI1D = constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8*, i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @_ZTS1D, i32 0, i32 0), i8* bitcast ({ i8*, i8*, i8* }* @_ZTI1B to i8*) }
@g = global i32 0, align 4
define void @_ZN1A3fooEv(%struct.A* %this) {
entry:
store i32 2, i32* @g, align 4
ret void
}
define void @_ZN1B3fooEv(%struct.B* %this) {
entry:
store i32 4, i32* @g, align 4
ret void
}
define void @_ZN1C3fooEv(%struct.C* %this) {
entry:
store i32 6, i32* @g, align 4
ret void
}
define void @_ZN1D3fooEv(%struct.D* %this) {
entry:
store i32 8, i32* @g, align 4
ret void
}
define linkonce_odr void @_ZN1AD0Ev(%struct.A* %this) {
entry:
%0 = bitcast %struct.A* %this to i8*
tail call void @_ZdlPv(i8* %0)
ret void
}
define linkonce_odr void @_ZN1BD0Ev(%struct.B* %this) {
entry:
%0 = bitcast %struct.B* %this to i8*
tail call void @_ZdlPv(i8* %0)
ret void
}
define linkonce_odr void @_ZN1CD0Ev(%struct.C* %this) {
entry:
%0 = bitcast %struct.C* %this to i8*
tail call void @_ZdlPv(i8* %0)
ret void
}
define linkonce_odr %struct.A* @_ZN1AD2Ev(%struct.A* returned %this) {
entry:
ret %struct.A* %this
}
define linkonce_odr void @_ZN1DD0Ev(%struct.D* %this) {
entry:
%0 = bitcast %struct.D* %this to i8*
tail call void @_ZdlPv(i8* %0)
ret void
}
declare void @_ZdlPv(i8*)