diff --git a/testsuite/tests/typing-layouts-arrays/array_element_size_in_bytes.ml b/testsuite/tests/typing-layouts-arrays/array_element_size_in_bytes.ml index 78baf213dcf..e8ce6e8a5b6 100644 --- a/testsuite/tests/typing-layouts-arrays/array_element_size_in_bytes.ml +++ b/testsuite/tests/typing-layouts-arrays/array_element_size_in_bytes.ml @@ -1,5 +1,4 @@ (* TEST - modules = "custom_block_padding.c"; flags = "-extension layouts_alpha"; flambda2; { @@ -11,13 +10,16 @@ (* CR layouts v7.1: move this test to beta/stable when product arrays are ready. *) -(* CR layouts v4: The below C stub is just to give this test slightly different - behavior on native code and bytecode, because some arrays of unboxed things - are represented as custom blocks on only native code, and therefore the size - calculations differ slightly. Delete this and the corresponding C file when - we change the representation to not use custom blocks. *) -external custom_block_padding : unit -> int = "custom_block_padding_byte" "custom_block_padding_native" -let custom_block_padding = custom_block_padding () +(* CR layouts v4: The below definition is just to give this test slightly + different behavior on native code and bytecode, because some arrays of + unboxed things are represented as custom blocks on only native code, and + therefore the size calculations differ slightly. Delete this when we change + the representation to not use custom blocks. *) +let custom_block_padding = + match Sys.backend_type with + | Native -> 1 + | Bytecode -> 0 + | Other _ -> failwith "Don't know what to do" (* We only compile for 64 bits. *) let bytes_per_word = 8 diff --git a/testsuite/tests/typing-layouts-arrays/custom_block_padding.c b/testsuite/tests/typing-layouts-arrays/custom_block_padding.c deleted file mode 100644 index c6340996e99..00000000000 --- a/testsuite/tests/typing-layouts-arrays/custom_block_padding.c +++ /dev/null @@ -1,11 +0,0 @@ -/* This C file is part of the [array_element_size_in_bytes.ml] test. See comment - there. It should eventually be deleted. */ -#include "caml/mlvalues.h" - -value custom_block_padding_native(value v) { - return(Val_long(1)); -} - -value custom_block_padding_byte(value v) { - return(Val_long(0)); -}