summaryrefslogtreecommitdiffstats
path: root/llvm/test/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-10-20 20:39:53 +0000
committerLang Hames <lhames@gmail.com>2018-10-20 20:39:53 +0000
commite433cf1fd718f90bb7118a49ccfceff8b515cde8 (patch)
tree1bec9e88edb4c2c06beacd99fbf849ef23c11d92 /llvm/test/ExecutionEngine
parenteae26bf73715994c2bd145f9b6dc3836aa4ffd4f (diff)
downloadbcm5719-llvm-e433cf1fd718f90bb7118a49ccfceff8b515cde8.tar.gz
bcm5719-llvm-e433cf1fd718f90bb7118a49ccfceff8b515cde8.zip
[ORC] Add some more basic sanity tests for the LLJIT.
minimal.ll contains a main function that returns zero, and single-function-call.ll contains a main function that calls a foo function that returns zero. These minimal tests can help to rule out some trivial JIT bugs when other tests fail. This commit also renames hello.ll to global-ctors-and-dtors.ll, which better reflects what it is actually testing. llvm-svn: 344863
Diffstat (limited to 'llvm/test/ExecutionEngine')
-rw-r--r--llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll (renamed from llvm/test/ExecutionEngine/OrcLazy/hello.ll)2
-rw-r--r--llvm/test/ExecutionEngine/OrcLazy/minimal.ll8
-rw-r--r--llvm/test/ExecutionEngine/OrcLazy/single-function-call.ll15
3 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/ExecutionEngine/OrcLazy/hello.ll b/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
index 86d9a9a4b31..00b54fbf73f 100644
--- a/llvm/test/ExecutionEngine/OrcLazy/hello.ll
+++ b/llvm/test/ExecutionEngine/OrcLazy/global-ctors-and-dtors.ll
@@ -1,5 +1,7 @@
; RUN: lli -jit-kind=orc-lazy -orc-lazy-debug=funcs-to-stdout %s | FileCheck %s
;
+; Test that global constructors and destructors are run.
+;
; CHECK: Hello
; CHECK: [ {{.*}}main{{.*}} ]
; CHECK: Goodbye
diff --git a/llvm/test/ExecutionEngine/OrcLazy/minimal.ll b/llvm/test/ExecutionEngine/OrcLazy/minimal.ll
new file mode 100644
index 00000000000..86087bc3878
--- /dev/null
+++ b/llvm/test/ExecutionEngine/OrcLazy/minimal.ll
@@ -0,0 +1,8 @@
+; RUN: lli -jit-kind=orc-lazy %s
+;
+; Basic sanity check: A module with a single no-op main function runs.
+
+define i32 @main(i32 %argc, i8** nocapture readnone %argv) {
+entry:
+ ret i32 0
+}
diff --git a/llvm/test/ExecutionEngine/OrcLazy/single-function-call.ll b/llvm/test/ExecutionEngine/OrcLazy/single-function-call.ll
new file mode 100644
index 00000000000..fba52026660
--- /dev/null
+++ b/llvm/test/ExecutionEngine/OrcLazy/single-function-call.ll
@@ -0,0 +1,15 @@
+; RUN: lli -jit-kind=orc-lazy %s
+;
+; Basic sanity check: We can make a call inside lazily JIT'd code.
+; Compared to minimal.ll, this demonstrates that we can call through a stub.
+
+define i32 @foo() {
+entry:
+ ret i32 0
+}
+
+define i32 @main(i32 %argc, i8** nocapture readnone %argv) {
+entry:
+ %0 = call i32() @foo()
+ ret i32 %0
+}
OpenPOWER on IntegriCloud