summaryrefslogtreecommitdiff
path: root/test/Bindings
diff options
context:
space:
mode:
authorAmaury Sechet <deadalnix@gmail.com>2016-02-11 21:37:54 +0000
committerAmaury Sechet <deadalnix@gmail.com>2016-02-11 21:37:54 +0000
commitc2e77df6b8baf8ffb49bf96ce296f71736cab0b6 (patch)
treee356253396a79aee79a90419bc9a64ed883db0e6 /test/Bindings
parentc83ca6a674886ea348f8c1612b49dfe26776c21f (diff)
Add support for phi nodes in the LLVM C API test
Summary: This required to add binding to Instruction::removeFromParent so that instruction can be forward declared and then moved at the right place. Reviewers: bogner, chandlerc, echristo, dblaikie, joker.eph, Wallbraker Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D17057 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bindings')
-rw-r--r--test/Bindings/llvm-c/echo.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Bindings/llvm-c/echo.ll b/test/Bindings/llvm-c/echo.ll
index d6c27ea8f30..df6de857af9 100644
--- a/test/Bindings/llvm-c/echo.ll
+++ b/test/Bindings/llvm-c/echo.ll
@@ -90,3 +90,19 @@ next8:
next9:
ret i32 0
}
+
+define i32 @loop(i32 %i) {
+ br label %cond
+cond:
+ %c = phi i32 [ %i, %0 ], [ %j, %do ]
+ %p = phi i32 [ %r, %do ], [ 789, %0 ]
+ %1 = icmp eq i32 %c, 0
+ br i1 %1, label %do, label %done
+do:
+ %2 = sub i32 %p, 23
+ %j = sub i32 %i, 1
+ %r = mul i32 %2, 3
+ br label %cond
+done:
+ ret i32 %p
+}