fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
669 B18 linesraw
1-include ../tools.mk
2
3# Test mixing pathless --extern with paths.
4
5all:
6	$(RUSTC) bar-static.rs --crate-name=bar --crate-type=rlib
7	$(RUSTC) bar-dynamic.rs --crate-name=bar --crate-type=dylib -C prefer-dynamic
8	# rlib preferred over dylib
9	$(RUSTC) foo.rs --extern bar
10	$(call RUN,foo) | $(CGREP) 'static'
11	$(RUSTC) foo.rs --extern bar=$(TMPDIR)/libbar.rlib --extern bar
12	$(call RUN,foo) | $(CGREP) 'static'
13	# explicit --extern overrides pathless
14	$(RUSTC) foo.rs --extern bar=$(call DYLIB,bar) --extern bar
15	$(call RUN,foo) | $(CGREP) 'dynamic'
16	# prefer-dynamic does what it says
17	$(RUSTC) foo.rs --extern bar -C prefer-dynamic
18	$(call RUN,foo) | $(CGREP) 'dynamic'