Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future bug report: select is confused by bigarray on ocaml 5.1.1 #9981

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Test case showing the weird behaviour of select
Signed-off-by: Ambre Austen Suhamy <ambre@tarides.com>
ElectreAAS committed Feb 12, 2024
commit f33fee5c7d4a6f89a141af543651e773eea93280
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/bigarray.t/c/dune
Original file line number Diff line number Diff line change
@@ -4,6 +4,8 @@
(select
c.ml
from
;; Depending on the order of the two lines below, output changes
;; the first is always selected...?
(!bigarray -> c.nobigarray.ml)
(bigarray -> c.bigarray.ml)
(-> c.dummy.ml))))
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/bigarray.t/d/d.bigarray.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let _c = Bigarray.C_layout_typ

let () = Printf.eprintf "Welcome to d WITH bigarray support\n%!"
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/bigarray.t/d/d.dummy.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = Printf.eprintf "Welcome to d with nothing inferred\n%!"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = Printf.eprintf "Welcome to d WITHOUT bigarray support\n%!"
11 changes: 11 additions & 0 deletions test/blackbox-tests/test-cases/bigarray.t/d/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(executable
(name d)
(libraries
(select
d.ml
from
;; Depending on the order of the two lines below, output changes
;; the first is always selected...?
(bigarray -> d.bigarray.ml)
(!bigarray -> d.nobigarray.ml)
(-> d.dummy.ml))))
7 changes: 6 additions & 1 deletion test/blackbox-tests/test-cases/bigarray.t/run.t
Original file line number Diff line number Diff line change
@@ -30,4 +30,9 @@ This test uses `(libraries (re_export bigarray))` similarly
Welcome to b
This test uses a `(select )` construct and should always select bigarray support
$ dune exec c/c.exe
Welcome to c WITH bigarray support
Welcome to c WITHOUT bigarray support

This test is the same as c but with the order of the branches in `select` reversed
This shouldn't matter but it does
$ dune exec d/d.exe
Welcome to d WITH bigarray support