From c2e77df6b8baf8ffb49bf96ce296f71736cab0b6 Mon Sep 17 00:00:00 2001 From: Amaury Sechet Date: Thu, 11 Feb 2016 21:37:54 +0000 Subject: 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 --- test/Bindings/llvm-c/echo.ll | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/Bindings') 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 +} -- cgit v1.2.3