summaryrefslogtreecommitdiffstats
path: root/test/Bindings/OCaml/executionengine.ml
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2015-03-23 12:10:34 -0700
committerStephen Hines <srhines@google.com>2015-03-23 12:10:34 -0700
commitebe69fe11e48d322045d5949c83283927a0d790b (patch)
treec92f1907a6b8006628a4b01615f38264d29834ea /test/Bindings/OCaml/executionengine.ml
parentb7d2e72b02a4cb8034f32f8247a2558d2434e121 (diff)
downloadexternal_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.zip
external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.gz
external_llvm-ebe69fe11e48d322045d5949c83283927a0d790b.tar.bz2
Update aosp/master LLVM for rebase to r230699.
Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
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 *)