[llvm] a502ac3 - [OCaml][Test] Do not use Option, expand using match

Vaivaswatha Nagaraj via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 26 10:14:13 PDT 2021


Author: Vaivaswatha Nagaraj
Date: 2021-03-26T22:41:29+05:30
New Revision: a502ac383e03af63fa5c5aa4c17c1d3aeade82d6

URL: https://github.com/llvm/llvm-project/commit/a502ac383e03af63fa5c5aa4c17c1d3aeade82d6
DIFF: https://github.com/llvm/llvm-project/commit/a502ac383e03af63fa5c5aa4c17c1d3aeade82d6.diff

LOG: [OCaml][Test] Do not use Option, expand using match

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

Added: 
    

Modified: 
    llvm/test/Bindings/OCaml/debuginfo.ml

Removed: 
    


################################################################################
diff  --git a/llvm/test/Bindings/OCaml/debuginfo.ml b/llvm/test/Bindings/OCaml/debuginfo.ml
index 345d8e8eb906..575fddea6f19 100644
--- a/llvm/test/Bindings/OCaml/debuginfo.ml
+++ b/llvm/test/Bindings/OCaml/debuginfo.ml
@@ -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


        


More information about the llvm-commits mailing list