aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorErick Tryzelaar <idadesub@users.sourceforge.net>2010-02-28 20:45:03 +0000
committerErick Tryzelaar <idadesub@users.sourceforge.net>2010-02-28 20:45:03 +0000
commitb65c5f2ec347db8342cb7e42d072b0088b74fa73 (patch)
tree8729f5e146e008e8344c3286ef8d3b21a14e1194 /test
parent6ba5c56cf5b1609ec4af45f4901118865a8ed9b6 (diff)
Add support getting the operands of a User to ocaml.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Bindings/Ocaml/vmcore.ml19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Bindings/Ocaml/vmcore.ml b/test/Bindings/Ocaml/vmcore.ml
index 1b7200b19f..cbd52e46bb 100644
--- a/test/Bindings/Ocaml/vmcore.ml
+++ b/test/Bindings/Ocaml/vmcore.ml
@@ -606,6 +606,24 @@ let test_global_variables () =
dispose_module m
end
+
+(*===-- Users -------------------------------------------------------------===*)
+
+let test_users () =
+ let ty = function_type i32_type [| i32_type; i32_type |] in
+ let fn = define_function "user_function" ty m in
+ let b = builder_at_end context (entry_block fn) in
+
+ let p1 = param fn 0 in
+ let p2 = param fn 1 in
+ let i = build_add p1 p2 "sum" b in
+
+ insist ((operand i 0) = p1);
+ insist ((operand i 1) = p2);
+
+ ignore (build_unreachable b)
+
+
(*===-- Aliases -----------------------------------------------------------===*)
let test_aliases () =
@@ -1273,6 +1291,7 @@ let _ =
suite "constants" test_constants;
suite "global values" test_global_values;
suite "global variables" test_global_variables;
+ suite "users" test_users;
suite "aliases" test_aliases;
suite "functions" test_functions;
suite "params" test_params;