[OCaml] Don't truncate constants over 32 bits in Llvm.const_int.
[oota-llvm.git] / test / Bindings / Ocaml / vmcore.ml
index f014116ffe8ea0a0c0b00b890b1cc30f4a51cb8f..53e0553b0d599ecc50b3d22768d48b2fa03a3bcf 100644 (file)
@@ -126,6 +126,12 @@ let test_constants () =
   ignore (define_global "const_int_string" c m);
   insist (i32_type = type_of c);
 
   ignore (define_global "const_int_string" c m);
   insist (i32_type = type_of c);
 
+  if Sys.word_size = 64; then begin
+    group "long int";
+    let c = const_int i64_type (1 lsl 61) in
+    insist (c = const_of_int64 i64_type (Int64.of_int (1 lsl 61)) false)
+  end;
+
   (* CHECK: @const_string = global {{.*}}c"cruel\00world"
    *)
   group "string";
   (* CHECK: @const_string = global {{.*}}c"cruel\00world"
    *)
   group "string";