Adding a basic ELF dynamic loader and MC-JIT for ELF. Functionality is currently basic and will be enhanced with future patches.

Patch developed by Andy Kaylor and Daniel Malea. Reviewed on llvm-commits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148231 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Bendersky
2012-01-16 08:56:09 +00:00
parent 810d6d3354
commit a66a18505e
46 changed files with 463 additions and 64 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: mcjit
@.LC0 = internal global [10 x i8] c"argc: %d\0A\00" ; <[10 x i8]*> [#uses=1]
@@ -1,5 +1,6 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; XFAIL: mcjit
define i32 @foo(i32 %X, i32 %Y, double %A) {
%cond212 = fcmp une double %A, 1.000000e+00 ; <i1> [#uses=1]
+2 -1
View File
@@ -1,5 +1,6 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; XFAIL: mcjit
define i32 @main() {
call i32 @mylog( i32 4 ) ; <i32>:1 [#uses=0]
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
; <label>:0
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; We were accidentally inverting the signedness of right shifts. Whoops.
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
%X = fadd double 0.000000e+00, 1.000000e+00 ; <double> [#uses=1]
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
define i32 @bar(i8* %X) {
@@ -1,7 +1,8 @@
; This testcase should return with an exit code of 1.
;
; RUN: not lli %s
; RUN: not %lli %s
; XFAIL: arm
; XFAIL: mcjit
@test = global i64 0 ; <i64*> [#uses=1]
@@ -1,5 +1,6 @@
; RUN: lli %s test
; RUN: %lli %s test
; XFAIL: arm
; XFAIL: mcjit
declare i32 @puts(i8*)
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
target datalayout = "e-p:32:32"
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; Testcase distilled from 256.bzip2.
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; Testcase distilled from 256.bzip2.
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; This testcase failed to work because two variable sized allocas confused the
@@ -1,5 +1,6 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; XFAIL: mcjit
;
; Regression Test: EnvironmentTest.ll
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; This testcase exposes a bug in the local register allocator where it runs out
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
@A = global i32 0 ; <i32*> [#uses=1]
@@ -1,6 +1,7 @@
; PR672
; RUN: lli %s
; RUN: %lli %s
; XFAIL: arm
; XFAIL: mcjit-ia32
define i32 @main() {
%f = bitcast i32 (i32, i32*, i32)* @check_tail to i32* ; <i32*> [#uses=1]
@@ -1,4 +1,4 @@
; RUN: lli -force-interpreter %s
; RUN: %lli -force-interpreter %s
; PR1836
define i32 @main() {
@@ -1,4 +1,4 @@
; RUN: lli -force-interpreter=true %s | grep 1
; RUN: %lli -force-interpreter=true %s | grep 1
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
target triple = "i686-pc-linux-gnu"
@@ -1,4 +1,4 @@
; RUN: lli -force-interpreter=true %s
; RUN: %lli -force-interpreter=true %s
define i32 @main() {
%a = add i32 0, undef
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli -force-interpreter=true %s | grep 40091eb8
; RUN: %lli -force-interpreter=true %s | grep 40091eb8
;
define i32 @test(double %x) {
entry:
+2 -1
View File
@@ -1,5 +1,6 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; XFAIL: mcjit
@.LC0 = internal global [12 x i8] c"Hello World\00" ; <[12 x i8]*> [#uses=1]
+2 -1
View File
@@ -1,5 +1,6 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; XFAIL: mcjit
@X = global i32 7 ; <i32*> [#uses=0]
@msg = internal global [13 x i8] c"Hello World\0A\00" ; <[13 x i8]*> [#uses=1]
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
ret i32 0
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
define i32 @bar() {
+2 -1
View File
@@ -1,5 +1,6 @@
; RUN: lli -disable-lazy-compilation=false %s
; RUN: %lli -disable-lazy-compilation=false %s
; XFAIL: arm
; XFAIL: mcjit
define i32 @main() nounwind {
entry:
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
%A = add i8 0, 12 ; <i8> [#uses=1]
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; test unconditional branch
define i32 @main() {
+2 -1
View File
@@ -1,5 +1,6 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; XFAIL: mcjit
declare void @exit(i32)
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @foo() {
ret i32 0
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; This tests to make sure that we can evaluate weird constant expressions
+2 -1
View File
@@ -1,4 +1,5 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: mcjit
define double @test(double* %DP, double %Arg) {
%D = load double* %DP ; <double> [#uses=1]
+2 -1
View File
@@ -1,5 +1,6 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; XFAIL: arm
; XFAIL: mcjit-ia32
define void @test(i8* %P, i16* %P.upgrd.1, i32* %P.upgrd.2, i64* %P.upgrd.3) {
%V = load i8* %P ; <i8> [#uses=1]
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
%A = and i8 4, 8 ; <i8> [#uses=2]
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
; <label>:0
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; test phi node
@Y = global i32 6 ; <i32*> [#uses=1]
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
; test return instructions
define void @test1() {
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
%int1 = add i32 0, 0 ; <i32> [#uses=6]
+1 -1
View File
@@ -1,4 +1,4 @@
; RUN: lli %s > /dev/null
; RUN: %lli %s > /dev/null
define i32 @main() {
%shamt = add i8 0, 1 ; <i8> [#uses=8]