[OCaml][Test] Do not use Option, expand using match
authorVaivaswatha Nagaraj <vaivaswatha@zilliqa.com>
Fri, 26 Mar 2021 17:09:58 +0000 (22:39 +0530)
committerVaivaswatha Nagaraj <vaivaswatha@zilliqa.com>
Fri, 26 Mar 2021 17:11:29 +0000 (22:41 +0530)
Option seems to be unsupported on the buildbot version
of OCaml. So expand the statements using a match.

Fixes buildbot failure due to
https://github.com/llvm/llvm-project/commit/c244cd72172ca8941f9f67fc183ade8afcd61c17

llvm/test/Bindings/OCaml/debuginfo.ml

index 345d8e8..575fdde 100644 (file)
@@ -183,10 +183,10 @@ let test_bbinstr f f_di file_di dibuilder =
     let file_of_f_di = Llvm_debuginfo.di_scope_get_file ~scope:f_di in
     let file_of_scope = Llvm_debuginfo.di_scope_get_file ~scope in
     insist
-      ( Option.is_some file_of_f_di
-      && Option.get file_of_f_di = file_di
-      && Option.is_some file_of_scope
-      && Option.get file_of_f_di = file_di );
+      ( match (file_of_f_di, file_of_scope) with
+      | Some file_of_f_di', Some file_of_scope' ->
+          file_of_f_di' = file_di && file_of_scope' = file_di
+      | _ -> false );
     let foocall = Llvm.build_call foodecl [| arg0 |] "" builder in
     let foocall_loc =
       Llvm_debuginfo.dibuild_create_debug_location context ~line:10 ~column:12