diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2019-11-30 13:31:16 +0100 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2019-11-30 13:35:23 +0100 |
commit | b094258661e0064133679b8b51e981eefda07ec7 (patch) | |
tree | 41f015d1cfb0882bcc21d87494cfdf7b04598a9d | |
parent | cee62e6fcff6e833bedca1554f6df8f8234e9b13 (diff) | |
download | bcm5719-llvm-b094258661e0064133679b8b51e981eefda07ec7.tar.gz bcm5719-llvm-b094258661e0064133679b8b51e981eefda07ec7.zip |
Updated the OCaml/bitwriter.ml test for OCaml 4.06+
Since OCaml 4.02 (released in 2014), strings and bytes are different
types, but up until OCaml 4.06, the compiler defaulted to a
compatibility mode "unsafe-string". OCaml 4.06 flips the default to
"safe-string", breaking the test.
This change should be compatible with OCaml 4.02+, but is only truly
necessary for OCaml 4.06+.
For more information, see:
https://caml.inria.fr/pub/docs/manual-ocaml/libref/String.html
https://ocaml.org/releases/4.02.html
-rw-r--r-- | llvm/test/Bindings/OCaml/bitwriter.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Bindings/OCaml/bitwriter.ml b/llvm/test/Bindings/OCaml/bitwriter.ml index 28a61fee91b..17111bd3b51 100644 --- a/llvm/test/Bindings/OCaml/bitwriter.ml +++ b/llvm/test/Bindings/OCaml/bitwriter.ml @@ -17,7 +17,7 @@ let test x = if not x then exit 1 else () let read_file name = let ic = open_in_bin name in let len = in_channel_length ic in - let buf = String.create len in + let buf = Bytes.create len in test ((input ic buf 0 len) = len); @@ -46,4 +46,4 @@ let _ = test (file_buf = temp_bitcode m); test (file_buf = temp_bitcode ~unbuffered:false m); test (file_buf = temp_bitcode ~unbuffered:true m); - test (file_buf = Llvm.MemoryBuffer.as_string (Llvm_bitwriter.write_bitcode_to_memory_buffer m)) + test (file_buf = Bytes.of_string (Llvm.MemoryBuffer.as_string (Llvm_bitwriter.write_bitcode_to_memory_buffer m))) |