summaryrefslogtreecommitdiff
path: root/test/ExecutionEngine/test-global-init-nonzero.ll
diff options
context:
space:
mode:
authorEli Bendersky <eli.bendersky@intel.com>2012-01-17 09:14:54 +0000
committerEli Bendersky <eli.bendersky@intel.com>2012-01-17 09:14:54 +0000
commita7f99f28a71635e83d85c68c47ca0fc20ec68400 (patch)
treef4fefe779a5038b141033a1b3dbcd2311b3f2d0b /test/ExecutionEngine/test-global-init-nonzero.ll
parent0b94b5f52b11092a69267159dfe0df3acdfcabd7 (diff)
downloadllvm-a7f99f28a71635e83d85c68c47ca0fc20ec68400.tar.gz
llvm-a7f99f28a71635e83d85c68c47ca0fc20ec68400.tar.bz2
llvm-a7f99f28a71635e83d85c68c47ca0fc20ec68400.tar.xz
Additional ExecutionEngine tests, as part of bringing up the MCJIT on ELF
implementation. Currently lit still executes ExecutionEngine tests with JIT (not MCJIT) by default. MCJIT tests can be executed manually by calling llvm-lit with --param jit_impl=mcjit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ExecutionEngine/test-global-init-nonzero.ll')
-rw-r--r--test/ExecutionEngine/test-global-init-nonzero.ll36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/ExecutionEngine/test-global-init-nonzero.ll b/test/ExecutionEngine/test-global-init-nonzero.ll
new file mode 100644
index 0000000000..a13bfc91f1
--- /dev/null
+++ b/test/ExecutionEngine/test-global-init-nonzero.ll
@@ -0,0 +1,36 @@
+; RUN: %lli %s > /dev/null
+; XFAIL: arm
+; XFAIL: mcjit
+
+@count = global i32 1, align 4
+
+define i32 @main() nounwind uwtable {
+entry:
+ %retval = alloca i32, align 4
+ %i = alloca i32, align 4
+ store i32 0, i32* %retval
+ store i32 0, i32* %i, align 4
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %0 = load i32* %i, align 4
+ %cmp = icmp slt i32 %0, 49
+ br i1 %cmp, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %1 = load i32* @count, align 4
+ %inc = add nsw i32 %1, 1
+ store i32 %inc, i32* @count, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %2 = load i32* %i, align 4
+ %inc1 = add nsw i32 %2, 1
+ store i32 %inc1, i32* %i, align 4
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ %3 = load i32* @count, align 4
+ %sub = sub nsw i32 %3, 50
+ ret i32 %sub
+}