diff options
Diffstat (limited to 'test/ExecutionEngine')
20 files changed, 98 insertions, 32 deletions
diff --git a/test/ExecutionEngine/MCJIT/lit.local.cfg b/test/ExecutionEngine/MCJIT/lit.local.cfg index fdb36ee..5dc749d 100644 --- a/test/ExecutionEngine/MCJIT/lit.local.cfg +++ b/test/ExecutionEngine/MCJIT/lit.local.cfg @@ -8,7 +8,7 @@ else: # FIXME: autoconf and cmake produce different arch names. We should normalize # them before getting here. -if root.host_arch not in ['i386', 'x86', 'x86_64', +if root.host_arch not in ['i386', 'x86', 'x86_64', 'AMD64', 'AArch64', 'ARM', 'Mips', 'PowerPC', 'ppc64', 'SystemZ']: config.unsupported = True diff --git a/test/ExecutionEngine/MCJIT/load-object-a.ll b/test/ExecutionEngine/MCJIT/load-object-a.ll new file mode 100644 index 0000000..9d27e41 --- /dev/null +++ b/test/ExecutionEngine/MCJIT/load-object-a.ll @@ -0,0 +1,24 @@ +; This first line will generate the .o files for the next run line +; RUN: rm -rf %t.cachedir %t.cachedir2 %t.cachedir3 +; RUN: mkdir -p %t.cachedir %t.cachedir2 %t.cachedir3 +; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -enable-cache-manager -object-cache-dir=%t.cachedir %s + +; Collect generated objects. +; RUN: find %t.cachedir -type f -name 'multi-module-?.o' -exec mv -v '{}' %t.cachedir2 ';' + +; This line tests MCJIT object loading +; RUN: %lli_mcjit -extra-object=%t.cachedir2/multi-module-b.o -extra-object=%t.cachedir2/multi-module-c.o %s + +; These lines put the object files into an archive +; RUN: llvm-ar r %t.cachedir3/load-object.a %t.cachedir2/multi-module-b.o +; RUN: llvm-ar r %t.cachedir3/load-object.a %t.cachedir2/multi-module-c.o + +; This line test MCJIT archive loading +; RUN: %lli_mcjit -extra-archive=%t.cachedir3/load-object.a %s + +declare i32 @FB() + +define i32 @main() { + %r = call i32 @FB( ) ; <i32> [#uses=1] + ret i32 %r +} diff --git a/test/ExecutionEngine/MCJIT/non-extern-addend-smallcodemodel.ll b/test/ExecutionEngine/MCJIT/non-extern-addend-smallcodemodel.ll new file mode 100644 index 0000000..21db67d --- /dev/null +++ b/test/ExecutionEngine/MCJIT/non-extern-addend-smallcodemodel.ll @@ -0,0 +1,25 @@ +; RUN: %lli_mcjit -code-model=small %s > /dev/null +; XFAIL: mips +; +; FIXME: Merge this file with non-extern-addend.ll once AArch64 supports PC-rel +; relocations in ELF. (The code is identical, only the run line differs). +; +define i32 @foo(i32 %x, i32 %y, double %d) { +entry: + %d.int64 = bitcast double %d to i64 + %d.top64 = lshr i64 %d.int64, 32 + %d.top = trunc i64 %d.top64 to i32 + %d.bottom = trunc i64 %d.int64 to i32 + %topCorrect = icmp eq i32 %d.top, 3735928559 + %bottomCorrect = icmp eq i32 %d.bottom, 4277009102 + %right = and i1 %topCorrect, %bottomCorrect + %nRight = xor i1 %right, true + %retVal = zext i1 %nRight to i32 + ret i32 %retVal +} + +define i32 @main() { +entry: + %call = call i32 @foo(i32 0, i32 1, double 0xDEADBEEFFEEDFACE) + ret i32 %call +} diff --git a/test/ExecutionEngine/MCJIT/non-extern-addend.ll b/test/ExecutionEngine/MCJIT/non-extern-addend.ll index 3a6e634..e0827f6 100644 --- a/test/ExecutionEngine/MCJIT/non-extern-addend.ll +++ b/test/ExecutionEngine/MCJIT/non-extern-addend.ll @@ -1,12 +1,21 @@ ; RUN: %lli_mcjit %s > /dev/null -define i32 @foo(i32 %X, i32 %Y, double %A) { - %cond212 = fcmp ueq double %A, 2.000000e+00 ; <i1> [#uses=1] - %cast110 = zext i1 %cond212 to i32 ; <i32> [#uses=1] - ret i32 %cast110 +define i32 @foo(i32 %x, i32 %y, double %d) { +entry: + %d.int64 = bitcast double %d to i64 + %d.top64 = lshr i64 %d.int64, 32 + %d.top = trunc i64 %d.top64 to i32 + %d.bottom = trunc i64 %d.int64 to i32 + %topCorrect = icmp eq i32 %d.top, 3735928559 + %bottomCorrect = icmp eq i32 %d.bottom, 4277009102 + %right = and i1 %topCorrect, %bottomCorrect + %nRight = xor i1 %right, true + %retVal = zext i1 %nRight to i32 + ret i32 %retVal } define i32 @main() { - %reg212 = call i32 @foo( i32 0, i32 1, double 1.000000e+00 ) ; <i32> [#uses=1] - ret i32 %reg212 +entry: + %call = call i32 @foo(i32 0, i32 1, double 0xDEADBEEFFEEDFACE) + ret i32 %call } diff --git a/test/ExecutionEngine/MCJIT/remote/Inputs/cross-module-b.ll b/test/ExecutionEngine/MCJIT/remote/Inputs/cross-module-b.ll index 6870117..bc13b1d 100644 --- a/test/ExecutionEngine/MCJIT/remote/Inputs/cross-module-b.ll +++ b/test/ExecutionEngine/MCJIT/remote/Inputs/cross-module-b.ll @@ -1,6 +1,6 @@ declare i32 @FA() -define i32 @FB() { +define i32 @FB() nounwind { %r = call i32 @FA( ) ; <i32> [#uses=1] ret i32 %r } diff --git a/test/ExecutionEngine/MCJIT/remote/Inputs/multi-module-b.ll b/test/ExecutionEngine/MCJIT/remote/Inputs/multi-module-b.ll index 103b601..0b8d5eb 100644 --- a/test/ExecutionEngine/MCJIT/remote/Inputs/multi-module-b.ll +++ b/test/ExecutionEngine/MCJIT/remote/Inputs/multi-module-b.ll @@ -1,6 +1,6 @@ declare i32 @FC() -define i32 @FB() { +define i32 @FB() nounwind { %r = call i32 @FC( ) ; <i32> [#uses=1] ret i32 %r } diff --git a/test/ExecutionEngine/MCJIT/remote/Inputs/multi-module-c.ll b/test/ExecutionEngine/MCJIT/remote/Inputs/multi-module-c.ll index b39306b..98350a8 100644 --- a/test/ExecutionEngine/MCJIT/remote/Inputs/multi-module-c.ll +++ b/test/ExecutionEngine/MCJIT/remote/Inputs/multi-module-c.ll @@ -1,4 +1,4 @@ -define i32 @FC() { +define i32 @FC() nounwind { ret i32 0 } diff --git a/test/ExecutionEngine/MCJIT/remote/cross-module-a.ll b/test/ExecutionEngine/MCJIT/remote/cross-module-a.ll index 094d362..b540bfa 100644 --- a/test/ExecutionEngine/MCJIT/remote/cross-module-a.ll +++ b/test/ExecutionEngine/MCJIT/remote/cross-module-a.ll @@ -1,13 +1,12 @@ -; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null +; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null declare i32 @FB() -define i32 @FA() { +define i32 @FA() nounwind { ret i32 0 } -define i32 @main() { +define i32 @main() nounwind { %r = call i32 @FB( ) ; <i32> [#uses=1] ret i32 %r } - diff --git a/test/ExecutionEngine/MCJIT/remote/cross-module-sm-pic-a.ll b/test/ExecutionEngine/MCJIT/remote/cross-module-sm-pic-a.ll index bdaa9a0..589ba2f 100644 --- a/test/ExecutionEngine/MCJIT/remote/cross-module-sm-pic-a.ll +++ b/test/ExecutionEngine/MCJIT/remote/cross-module-sm-pic-a.ll @@ -1,4 +1,4 @@ -; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target -relocation-model=pic -code-model=small %s > /dev/null +; RUN: %lli_mcjit -extra-module=%p/Inputs/cross-module-b.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null ; XFAIL: mips, i686, i386, arm declare i32 @FB() diff --git a/test/ExecutionEngine/MCJIT/remote/lit.local.cfg b/test/ExecutionEngine/MCJIT/remote/lit.local.cfg index 6b192ae..625d82d 100644 --- a/test/ExecutionEngine/MCJIT/remote/lit.local.cfg +++ b/test/ExecutionEngine/MCJIT/remote/lit.local.cfg @@ -1,3 +1,8 @@ if 'armv4' in config.root.target_triple or \ - 'armv5' in config.root.target_triple: + 'armv5' in config.root.target_triple: config.unsupported = True + +# This is temporary, until Remote MCJIT works on ARM +# See http://llvm.org/bugs/show_bug.cgi?id=18057 +#if 'armv7' in config.root.target_triple: +# config.unsupported = True diff --git a/test/ExecutionEngine/MCJIT/remote/multi-module-a.ll b/test/ExecutionEngine/MCJIT/remote/multi-module-a.ll index 91d0387..fbbb8bd 100644 --- a/test/ExecutionEngine/MCJIT/remote/multi-module-a.ll +++ b/test/ExecutionEngine/MCJIT/remote/multi-module-a.ll @@ -1,8 +1,8 @@ -; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null +; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null declare i32 @FB() -define i32 @main() { +define i32 @main() nounwind { %r = call i32 @FB( ) ; <i32> [#uses=1] ret i32 %r } diff --git a/test/ExecutionEngine/MCJIT/remote/multi-module-sm-pic-a.ll b/test/ExecutionEngine/MCJIT/remote/multi-module-sm-pic-a.ll index 73228e4..9c23169 100644 --- a/test/ExecutionEngine/MCJIT/remote/multi-module-sm-pic-a.ll +++ b/test/ExecutionEngine/MCJIT/remote/multi-module-sm-pic-a.ll @@ -1,4 +1,4 @@ -; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target -relocation-model=pic -code-model=small %s > /dev/null +; RUN: %lli_mcjit -extra-module=%p/Inputs/multi-module-b.ll -extra-module=%p/Inputs/multi-module-c.ll -disable-lazy-compilation=true -remote-mcjit -mcjit-remote-process=lli-child-target%exeext -relocation-model=pic -code-model=small %s > /dev/null ; XFAIL: mips, i686, i386, arm declare i32 @FB() diff --git a/test/ExecutionEngine/MCJIT/remote/simpletest-remote.ll b/test/ExecutionEngine/MCJIT/remote/simpletest-remote.ll index d10a411..6c8ab3d 100644 --- a/test/ExecutionEngine/MCJIT/remote/simpletest-remote.ll +++ b/test/ExecutionEngine/MCJIT/remote/simpletest-remote.ll @@ -1,10 +1,10 @@ -; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null +; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null -define i32 @bar() { +define i32 @bar() nounwind { ret i32 0 } -define i32 @main() { +define i32 @main() nounwind { %r = call i32 @bar( ) ; <i32> [#uses=1] ret i32 %r } diff --git a/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll b/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll index 97932bc..48b939b 100644 --- a/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll +++ b/test/ExecutionEngine/MCJIT/remote/stubs-remote.ll @@ -1,4 +1,4 @@ -; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target %s +; RUN: %lli_mcjit -remote-mcjit -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s ; XFAIL: * ; This test should fail until remote symbol resolution is supported. diff --git a/test/ExecutionEngine/MCJIT/remote/test-common-symbols-remote.ll b/test/ExecutionEngine/MCJIT/remote/test-common-symbols-remote.ll index 6328089..e07178e 100644 --- a/test/ExecutionEngine/MCJIT/remote/test-common-symbols-remote.ll +++ b/test/ExecutionEngine/MCJIT/remote/test-common-symbols-remote.ll @@ -1,4 +1,4 @@ -; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target %s +; RUN: %lli_mcjit -remote-mcjit -O0 -disable-lazy-compilation=false -mcjit-remote-process=lli-child-target%exeext %s ; The intention of this test is to verify that symbols mapped to COMMON in ELF ; work as expected. diff --git a/test/ExecutionEngine/MCJIT/remote/test-data-align-remote.ll b/test/ExecutionEngine/MCJIT/remote/test-data-align-remote.ll index 6b2b97b..129350b 100644 --- a/test/ExecutionEngine/MCJIT/remote/test-data-align-remote.ll +++ b/test/ExecutionEngine/MCJIT/remote/test-data-align-remote.ll @@ -1,9 +1,9 @@ -; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target %s +; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s ; Check that a variable is always aligned as specified. @var = global i32 0, align 32 -define i32 @main() { +define i32 @main() nounwind { %addr = ptrtoint i32* @var to i64 %mask = and i64 %addr, 31 %tst = icmp eq i64 %mask, 0 diff --git a/test/ExecutionEngine/MCJIT/remote/test-fp-no-external-funcs-remote.ll b/test/ExecutionEngine/MCJIT/remote/test-fp-no-external-funcs-remote.ll index a8a93a8..8eec0f2 100644 --- a/test/ExecutionEngine/MCJIT/remote/test-fp-no-external-funcs-remote.ll +++ b/test/ExecutionEngine/MCJIT/remote/test-fp-no-external-funcs-remote.ll @@ -1,6 +1,6 @@ -; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null +; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null -define double @test(double* %DP, double %Arg) { +define double @test(double* %DP, double %Arg) nounwind { %D = load double* %DP ; <double> [#uses=1] %V = fadd double %D, 1.000000e+00 ; <double> [#uses=2] %W = fsub double %V, %V ; <double> [#uses=3] @@ -12,7 +12,7 @@ define double @test(double* %DP, double %Arg) { ret double %Y } -define i32 @main() { +define i32 @main() nounwind { %X = alloca double ; <double*> [#uses=2] store double 0.000000e+00, double* %X call double @test( double* %X, double 2.000000e+00 ) ; <double>:1 [#uses=0] diff --git a/test/ExecutionEngine/MCJIT/remote/test-global-init-nonzero-remote.ll b/test/ExecutionEngine/MCJIT/remote/test-global-init-nonzero-remote.ll index 4181fb0..9fbaeb7 100644 --- a/test/ExecutionEngine/MCJIT/remote/test-global-init-nonzero-remote.ll +++ b/test/ExecutionEngine/MCJIT/remote/test-global-init-nonzero-remote.ll @@ -1,8 +1,8 @@ -; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target %s > /dev/null +; RUN: %lli_mcjit -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s > /dev/null @count = global i32 1, align 4 -define i32 @main() nounwind uwtable { +define i32 @main() nounwind { entry: %retval = alloca i32, align 4 %i = alloca i32, align 4 diff --git a/test/ExecutionEngine/MCJIT/remote/test-ptr-reloc-remote.ll b/test/ExecutionEngine/MCJIT/remote/test-ptr-reloc-remote.ll index 8b56297..d62631f 100644 --- a/test/ExecutionEngine/MCJIT/remote/test-ptr-reloc-remote.ll +++ b/test/ExecutionEngine/MCJIT/remote/test-ptr-reloc-remote.ll @@ -1,4 +1,4 @@ -; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target %s +; RUN: %lli_mcjit -remote-mcjit -O0 -mcjit-remote-process=lli-child-target%exeext %s @.str = private unnamed_addr constant [6 x i8] c"data1\00", align 1 @ptr = global i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), align 4 diff --git a/test/ExecutionEngine/lit.local.cfg b/test/ExecutionEngine/lit.local.cfg index 28c56ad..a198439 100644 --- a/test/ExecutionEngine/lit.local.cfg +++ b/test/ExecutionEngine/lit.local.cfg @@ -1,6 +1,10 @@ if config.root.host_arch in ['PowerPC', 'AArch64', 'SystemZ']: config.unsupported = True +# CMake and autoconf diverge in naming or host_arch +if 'aarch64' in config.root.target_triple: + config.unsupported = True + if 'hexagon' in config.root.target_triple: config.unsupported = True |