[llvm] [OCaml][test] Use correct data layout string. (PR #68781)

Harald van Dijk via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 02:43:37 PDT 2023


https://github.com/hvdijk created https://github.com/llvm/llvm-project/pull/68781

core.ml would previously set a data layout string of "e" and check that it remained "e". This is fragile when we have the data layout string auto-upgrade facility, and indeed broke when D86310 upgraded this one. As the auto-upgrade logic is not what is being tested here, it seems easier to just use the data layout string that the target expects.

>From 462d7f3f01559e2f6fa4432ce5338ba64f1284bc Mon Sep 17 00:00:00 2001
From: Harald van Dijk <harald at gigawatt.nl>
Date: Wed, 11 Oct 2023 10:39:34 +0100
Subject: [PATCH] [OCaml][test] Use correct data layout string.

core.ml would previously set a data layout string of "e" and check that
it remained "e". This is fragile when we have the data layout string
auto-upgrade facility, and indeed broke when D86310 upgraded this one.
As the auto-upgrade logic is not what is being tested here, it seems
easier to just use the data layout string that the target expects.
---
 llvm/test/Bindings/OCaml/core.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/test/Bindings/OCaml/core.ml b/llvm/test/Bindings/OCaml/core.ml
index 3a9c3c84238d702..1f6ece9532f1943 100644
--- a/llvm/test/Bindings/OCaml/core.ml
+++ b/llvm/test/Bindings/OCaml/core.ml
@@ -71,11 +71,11 @@ let test_target () =
   end;
 
   begin group "layout";
-    let layout = "e" in
+    let layout = "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:128-n8:16:32-S128" in
     set_data_layout layout m;
     insist (layout = data_layout m)
   end
-  (* CHECK: target datalayout = "e"
+  (* CHECK: target datalayout = "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:128-n8:16:32-S128"
    * CHECK: target triple = "i686-apple-darwin8"
    *)
 



More information about the llvm-commits mailing list