[PATCH] D19828: [OCaml] Update core test and re-enable testing

Jeroen Ketema via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 13:25:55 PDT 2016


jketema created this revision.
jketema added a reviewer: whitequark.
jketema added a subscriber: llvm-commits.

Update the OCaml core test to use the current IR syntax in its check lines. Also drop the creation of debug meta-data, as this is currently not supported by the C interface.

http://reviews.llvm.org/D19828

Files:
  test/Bindings/OCaml/core.ml
  test/Bindings/OCaml/lit.local.cfg

Index: test/Bindings/OCaml/lit.local.cfg
===================================================================
--- test/Bindings/OCaml/lit.local.cfg
+++ test/Bindings/OCaml/lit.local.cfg
@@ -1,8 +1,5 @@
 config.suffixes = ['.ml']
 
-# Temporarily disable the tests for the OCaml bindings until they're updated.
-config.unsupported = True
-
 if not 'ocaml' in config.root.llvm_bindings:
     config.unsupported = True
 
Index: test/Bindings/OCaml/core.ml
===================================================================
--- test/Bindings/OCaml/core.ml
+++ test/Bindings/OCaml/core.ml
@@ -624,7 +624,7 @@
 (*===-- Aliases -----------------------------------------------------------===*)
 
 let test_aliases () =
-  (* CHECK: @alias = alias i32* @aliasee
+  (* CHECK: @alias = alias i32, i32* @aliasee
    *)
   let forty_two32 = const_int i32_type 42 in
   let v = define_global "aliasee" forty_two32 m in
@@ -961,7 +961,7 @@
   group "function attribute";
   begin
       ignore (add_function_attr fn Attribute.UWTable);
-      (* CHECK: X7{{.*}}#0
+      (* CHECK: X7{{.*}}#0{{.*}}personality{{.*}}@__gxx_personality_v0
        * #0 is uwtable, defined at EOF.
        *)
       insist ([Attribute.UWTable] = function_attr fn);
@@ -1142,27 +1142,6 @@
     insist ((get_named_metadata m "llvm.module.flags") = [| md |])
   end;
 
-  group "dbg"; begin
-    (* CHECK: %dbg = add i32 %P1, %P2, !dbg !2
-     * !2 is metadata emitted at EOF.
-     *)
-    insist ((current_debug_location atentry) = Some (mdnode context [||]));
-
-    let m_line = const_int i32_type 2 in
-    let m_col = const_int i32_type 3 in
-    let m_scope = mdnode context [| |] in
-    let m_inlined = mdnode context [| |] in
-    let md = mdnode context [| m_line; m_col; m_scope; m_inlined |] in
-    set_current_debug_location atentry md;
-
-    insist ((current_debug_location atentry) = Some md);
-
-    let i = build_add p1 p2 "dbg" atentry in
-    insist ((has_metadata i) = true);
-
-    clear_current_debug_location atentry
-  end;
-
   group "ret"; begin
     (* CHECK: ret{{.*}}P1
      *)
@@ -1191,7 +1170,7 @@
            add_clause lp (const_array ety [| ztipkc; ztid |]);
            ignore (build_resume lp (builder_at_end context bblpad));
       end;
-      (* CHECK: landingpad{{.*}}personality{{.*}}__gxx_personality_v0
+      (* CHECK: landingpad
        * CHECK: cleanup
        * CHECK: catch{{.*}}i8**{{.*}}@_ZTIc
        * CHECK: filter{{.*}}@_ZTIPKc{{.*}}@_ZTId
@@ -1362,10 +1341,10 @@
 
     (* CHECK: %build_alloca = alloca i32
      * CHECK: %build_array_alloca = alloca i32, i32 %P2
-     * CHECK: %build_load = load volatile i32* %build_array_alloca, align 4
+     * CHECK: %build_load = load volatile i32, i32* %build_array_alloca, align 4
      * CHECK: store volatile i32 %P2, i32* %build_alloca, align 4
-     * CHECK: %build_gep = getelementptr i32* %build_array_alloca, i32 %P2
-     * CHECK: %build_in_bounds_gep = getelementptr inbounds i32* %build_array_alloca, i32 %P2
+     * CHECK: %build_gep = getelementptr i32, i32* %build_array_alloca, i32 %P2
+     * CHECK: %build_in_bounds_gep = getelementptr inbounds i32, i32* %build_array_alloca, i32 %P2
      * CHECK: %build_struct_gep = getelementptr inbounds{{.*}}%build_alloca2, i32 0, i32 1
      * CHECK: %build_atomicrmw = atomicrmw xchg i8* %p, i8 42 seq_cst
      *)
@@ -1443,9 +1422,8 @@
 (* End-of-file checks for things like metdata and attributes.
  * CHECK: attributes #0 = {{.*}}uwtable{{.*}}
  * CHECK: !llvm.module.flags = !{!0}
- * CHECK: !0 = !{i32 1, !"Debug Info Version", i32 3}
+ * CHECK: !0 = !{i32 1, !"Debug Info Version", i32 2}
  * CHECK: !1 = !{i32 1, !"metadata test"}
- * CHECK: !2 = !DILocation(line: 2, column: 3, scope: !3, inlinedAt: !3)
  *)
 
 (*===-- Pass Managers -----------------------------------------------------===*)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19828.55882.patch
Type: text/x-patch
Size: 3821 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160502/bb16f176/attachment.bin>


More information about the llvm-commits mailing list