File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
test/blackbox-tests/test-cases/duplicate-c-cxx Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -109,5 +109,22 @@ let make (d : _ Dir_with_dune.t)
109109 in this directory"
110110 Lib_name. pp_quoted name
111111 in
112+ let () =
113+ let rev_map =
114+ List. concat_map libs ~f: (fun (_ , c_sources ) ->
115+ String.Map. values c_sources
116+ |> List. map ~f: (fun (loc , source ) ->
117+ (C.Source. path source, loc)))
118+ |> Path.Map. of_list
119+ in
120+ match rev_map with
121+ | Ok _ -> ()
122+ | Error (_ , loc1 , loc2 ) ->
123+ Errors. fail loc2
124+ " This c stub is already used in another stanza:@\n \
125+ @[<v>%a@]@\n "
126+ (Fmt. prefix (Fmt. string " - " ) Loc. pp_file_colon_line)
127+ loc1
128+ in
112129 { libraries
113130 }
Original file line number Diff line number Diff line change @@ -10,7 +10,10 @@ c_names and cxx_names with overlapping names in the same stanza
1010c_names with overlapping names in different stanzas
1111 $ dune build -- root diff-stanza @ all
1212 Entering directory ' diff-stanza'
13- Multiple rules generated for _build/ default / foo$ext_obj:
14- - dune: 9
13+ File " dune" , line 9 , characters 10 -13:
14+ 9 | (c_names foo))
15+ ^^ ^
16+ Error: This c stub is already used in another stanza:
1517 - dune: 4
18+
1619 [1 ]
You can’t perform that action at this time.
0 commit comments