summaryrefslogtreecommitdiff
path: root/test/Bindings
diff options
context:
space:
mode:
authorErick Tryzelaar <idadesub@users.sourceforge.net>2009-08-16 23:37:03 +0000
committerErick Tryzelaar <idadesub@users.sourceforge.net>2009-08-16 23:37:03 +0000
commit45d6ac2cc13f7881687c2d7f03f9b9892fd85e6e (patch)
tree837c8a8dec14edd390965b6777e880a70b6f6c9b /test/Bindings
parente0a1bf64c9885df16bf596447d037f1c75f92637 (diff)
downloadllvm-45d6ac2cc13f7881687c2d7f03f9b9892fd85e6e.tar.gz
llvm-45d6ac2cc13f7881687c2d7f03f9b9892fd85e6e.tar.bz2
llvm-45d6ac2cc13f7881687c2d7f03f9b9892fd85e6e.tar.xz
Expose creating constant ints and floats from strings to ocaml.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79214 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bindings')
-rw-r--r--test/Bindings/Ocaml/vmcore.ml12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Bindings/Ocaml/vmcore.ml b/test/Bindings/Ocaml/vmcore.ml
index ca15c65c3b..c6c5e17566 100644
--- a/test/Bindings/Ocaml/vmcore.ml
+++ b/test/Bindings/Ocaml/vmcore.ml
@@ -212,6 +212,13 @@ let test_constants () =
ignore (define_global "Const03" c m);
insist (i64_type = type_of c);
+ (* RUN: grep {ConstIntString.*i32.*-1} < %t.ll
+ *)
+ group "int string";
+ let c = const_int_of_string i32_type "-1" 10 in
+ ignore (define_global "ConstIntString" c m);
+ insist (i32_type = type_of c);
+
(* RUN: grep {Const04.*"cruel\\\\00world"} < %t.ll
*)
group "string";
@@ -228,6 +235,7 @@ let test_constants () =
(* RUN: grep {ConstSingle.*2.75} < %t.ll
* RUN: grep {ConstDouble.*3.1459} < %t.ll
+ * RUN: grep {ConstDoubleString.*1.25} < %t.ll
*)
begin group "real";
let cs = const_float float_type 2.75 in
@@ -236,6 +244,10 @@ let test_constants () =
let cd = const_float double_type 3.1459 in
ignore (define_global "ConstDouble" cd m);
+ insist (double_type = type_of cd);
+
+ let cd = const_float_of_string double_type "1.25" in
+ ignore (define_global "ConstDoubleString" cd m);
insist (double_type = type_of cd)
end;