Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@ -0,0 +1,9 @@
define linkonce_odr i32 @baz() #0 {
entry:
ret i32 0
}
define i8* @bar() {
entry:
ret i8* bitcast (i32 ()* @baz to i8*)
}

View File

@ -0,0 +1,18 @@
; RUN: lli -jit-kind=orc-lazy %s
define private void @0() {
entry:
ret void
}
define private void @"\01L_foo"() {
entry:
ret void
}
define i32 @main(i32 %argc, i8** nocapture readnone %argv) {
entry:
call void @0()
tail call void @"\01L_foo"()
ret i32 0
}

View File

@ -0,0 +1,18 @@
; RUN: lli -jit-kind=orc-lazy %s | FileCheck %s
;
; CHECK: 7
@x = common global i32 0, align 4
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
define i32 @main() {
entry:
%retval = alloca i32, align 4
store i32 0, i32* %retval, align 4
store i32 7, i32* @x, align 4
%0 = load i32, i32* @x, align 4
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %0)
ret i32 0
}
declare i32 @printf(i8*, ...)

View File

@ -0,0 +1,21 @@
; RUN: lli -jit-kind=orc-lazy %s
;
; Test handling of global aliases for function and variables.
@x = global i32 42, align 4
@y = alias i32, i32* @x
define i32 @foo() {
entry:
%0 = load i32, i32* @y, align 4
ret i32 %0
}
@bar = alias i32(), i32()* @foo
define i32 @main(i32 %argc, i8** %argv) {
entry:
%0 = call i32() @bar()
%1 = sub i32 %0, 42
ret i32 %1
}

View File

@ -0,0 +1,35 @@
; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout %s | FileCheck %s
;
; CHECK: Hello
; CHECK: [ {{.*}}main ]
; CHECK: Goodbye
%class.Foo = type { i8 }
@f = global %class.Foo zeroinitializer, align 1
@__dso_handle = external global i8
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_hello.cpp, i8* null }]
@str = private unnamed_addr constant [6 x i8] c"Hello\00"
@str2 = private unnamed_addr constant [8 x i8] c"Goodbye\00"
define linkonce_odr void @_ZN3FooD1Ev(%class.Foo* nocapture readnone %this) unnamed_addr align 2 {
entry:
%puts.i = tail call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str2, i64 0, i64 0))
ret void
}
declare i32 @__cxa_atexit(void (i8*)*, i8*, i8*)
define i32 @main(i32 %argc, i8** nocapture readnone %argv) {
entry:
ret i32 0
}
define internal void @_GLOBAL__sub_I_hello.cpp() {
entry:
%puts.i.i.i = tail call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%0 = tail call i32 @__cxa_atexit(void (i8*)* bitcast (void (%class.Foo*)* @_ZN3FooD1Ev to void (i8*)*), i8* getelementptr inbounds (%class.Foo, %class.Foo* @f, i64 0, i32 0), i8* @__dso_handle)
ret void
}
declare i32 @puts(i8* nocapture readonly)

View File

@ -0,0 +1,8 @@
import sys
if config.root.host_arch not in ['i386', 'x86', 'x86_64', 'AMD64']:
config.unsupported = True
# FIXME: These tests don't pass with the COFF rtld.
if sys.platform == 'win32':
config.unsupported = True

View File

@ -0,0 +1,13 @@
; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=mods-to-stdout %s | FileCheck %s
;
; CHECK: module-flags.ll.globals
; CHECK-NOT: Module End
; CHECK: The Answer is {{.*}}42
define i32 @main() {
ret i32 0
}
!llvm.module.flags = !{!0}
!0 = !{i32 1, !"The Answer is ", i32 42}

View File

@ -0,0 +1,12 @@
; RUN: lli -jit-kind=orc-lazy %s
define private void @_ZL3foov() {
entry:
ret void
}
define i32 @main(i32 %argc, i8** nocapture readnone %argv) {
entry:
tail call void @_ZL3foov()
ret i32 0
}

View File

@ -0,0 +1,26 @@
; RUN: lli -jit-kind=orc-lazy -extra-module %p/Inputs/weak-function-2.ll %s
;
; Check that functions in two different modules agree on the address of weak
; function 'baz'
define linkonce_odr i32 @baz() {
entry:
ret i32 0
}
define i8* @foo() {
entry:
ret i8* bitcast (i32 ()* @baz to i8*)
}
declare i8* @bar()
define i32 @main(i32 %argc, i8** %argv) {
entry:
%call = tail call i8* @foo()
%call1 = tail call i8* @bar()
%cmp = icmp ne i8* %call, %call1
%conv = zext i1 %cmp to i32
ret i32 %conv
}