aboutsummaryrefslogtreecommitdiffstats
path: root/test/Bindings/OCaml/executionengine.ml
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2015-04-01 18:49:24 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-01 18:49:26 +0000
commit3fa16bd6062e23bcdb82ed4dd965674792e6b761 (patch)
tree9348fc507292f7e8715d22d64ce5a32131b4f875 /test/Bindings/OCaml/executionengine.ml
parentbeed47390a60f6f0c77532b3d3f76bb47ef49423 (diff)
parentebe69fe11e48d322045d5949c83283927a0d790b (diff)
downloadexternal_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.zip
external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.gz
external_llvm-3fa16bd6062e23bcdb82ed4dd965674792e6b761.tar.bz2
Merge "Update aosp/master LLVM for rebase to r230699."
Diffstat (limited to 'test/Bindings/OCaml/executionengine.ml')
-rw-r--r--test/Bindings/OCaml/executionengine.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/Bindings/OCaml/executionengine.ml b/test/Bindings/OCaml/executionengine.ml
index 893f988..1de2cfb 100644
--- a/test/Bindings/OCaml/executionengine.ml
+++ b/test/Bindings/OCaml/executionengine.ml
@@ -50,7 +50,10 @@ let test_executionengine () =
let ee = create m in
(* add plus *)
- let plus = define_plus m in
+ ignore (define_plus m);
+
+ (* declare global variable *)
+ ignore (define_global "globvar" (const_int i32_type 23) m);
(* add module *)
let m2 = create_module (global_context ()) "test_module2" in
@@ -73,9 +76,13 @@ let test_executionengine () =
(* run_static_ctors *)
run_static_ctors ee;
+ (* get a handle on globvar *)
+ let varh = get_global_value_address "globvar" int32_t ee in
+ if 23l <> varh then bomb "get_global_value_address didn't work";
+
(* call plus *)
let cplusty = Foreign.funptr (int32_t @-> int32_t @-> returning int32_t) in
- let cplus = get_pointer_to_global plus cplusty ee in
+ let cplus = get_function_address "plus" cplusty ee in
if 4l <> cplus 2l 2l then bomb "plus didn't work";
(* call getglobal *)