aboutsummaryrefslogtreecommitdiff
path: root/test/ExecutionEngine/MCJIT/test-local.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-08-15 19:34:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-08-15 19:34:23 +0000
commit58b69754af0cbff56b1cfce9be9392e4451f6628 (patch)
treeeacfc83d988e4b9d11114387ae7dc41243f2a363 /test/ExecutionEngine/MCJIT/test-local.ll
parent0378662f5bd3dbe8305a485b0282bceb8b52f465 (diff)
downloadsrc-58b69754af0cbff56b1cfce9be9392e4451f6628.tar.gz
src-58b69754af0cbff56b1cfce9be9392e4451f6628.zip
Vendor import of llvm trunk r161861:vendor/llvm/llvm-trunk-r161861
Notes
Notes: svn path=/vendor/llvm/dist/; revision=239310 svn path=/vendor/llvm/llvm-trunk-r161861/; revision=239311; tag=vendor/llvm/llvm-trunk-r161861
Diffstat (limited to 'test/ExecutionEngine/MCJIT/test-local.ll')
-rw-r--r--test/ExecutionEngine/MCJIT/test-local.ll34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/ExecutionEngine/MCJIT/test-local.ll b/test/ExecutionEngine/MCJIT/test-local.ll
new file mode 100644
index 000000000000..4f5ae47dd048
--- /dev/null
+++ b/test/ExecutionEngine/MCJIT/test-local.ll
@@ -0,0 +1,34 @@
+; RUN: %lli -use-mcjit %s > /dev/null
+
+define i32 @main() nounwind uwtable {
+entry:
+ %retval = alloca i32, align 4
+ %count = alloca i32, align 4
+ %i = alloca i32, align 4
+ store i32 0, i32* %retval
+ store i32 0, i32* %count, align 4
+ 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, 50
+ 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
+}