From ebe69fe11e48d322045d5949c83283927a0d790b Mon Sep 17 00:00:00 2001 From: Stephen Hines Date: Mon, 23 Mar 2015 12:10:34 -0700 Subject: Update aosp/master LLVM for rebase to r230699. Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9 --- test/Bindings/OCaml/executionengine.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test/Bindings/OCaml/executionengine.ml') 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 *) -- cgit v1.1