2022-08-23 00:00:00 +00:00
|
|
|
include ../tools.mk
|
2014-12-16 22:32:02 +00:00
|
|
|
|
2023-04-02 21:25:20 +00:00
|
|
|
# ignore-wasm32 (need a C compiler)
|
|
|
|
# ignore-wasm64 (need a C compiler)
|
|
|
|
|
2014-12-16 22:32:02 +00:00
|
|
|
all: $(TMPDIR)/libnative.a
|
|
|
|
mkdir -p $(TMPDIR)/crate
|
|
|
|
mkdir -p $(TMPDIR)/native
|
|
|
|
mv $(TMPDIR)/libnative.a $(TMPDIR)/native
|
|
|
|
$(RUSTC) a.rs
|
|
|
|
mv $(TMPDIR)/liba.rlib $(TMPDIR)/crate
|
2014-12-31 23:10:45 +00:00
|
|
|
$(RUSTC) b.rs -L native=$(TMPDIR)/crate && exit 1 || exit 0
|
|
|
|
$(RUSTC) b.rs -L dependency=$(TMPDIR)/crate && exit 1 || exit 0
|
|
|
|
$(RUSTC) b.rs -L crate=$(TMPDIR)/crate
|
|
|
|
$(RUSTC) b.rs -L all=$(TMPDIR)/crate
|
|
|
|
$(RUSTC) c.rs -L native=$(TMPDIR)/crate && exit 1 || exit 0
|
|
|
|
$(RUSTC) c.rs -L crate=$(TMPDIR)/crate && exit 1 || exit 0
|
|
|
|
$(RUSTC) c.rs -L dependency=$(TMPDIR)/crate
|
|
|
|
$(RUSTC) c.rs -L all=$(TMPDIR)/crate
|
|
|
|
$(RUSTC) d.rs -L dependency=$(TMPDIR)/native && exit 1 || exit 0
|
|
|
|
$(RUSTC) d.rs -L crate=$(TMPDIR)/native && exit 1 || exit 0
|
|
|
|
$(RUSTC) d.rs -L native=$(TMPDIR)/native
|
|
|
|
$(RUSTC) d.rs -L all=$(TMPDIR)/native
|
2016-04-05 02:07:08 +00:00
|
|
|
# Deduplication tests:
|
|
|
|
# Same hash, no errors.
|
2014-12-16 22:32:02 +00:00
|
|
|
mkdir -p $(TMPDIR)/e1
|
|
|
|
mkdir -p $(TMPDIR)/e2
|
|
|
|
$(RUSTC) e.rs -o $(TMPDIR)/e1/libe.rlib
|
|
|
|
$(RUSTC) e.rs -o $(TMPDIR)/e2/libe.rlib
|
2016-04-05 02:07:08 +00:00
|
|
|
$(RUSTC) f.rs -L $(TMPDIR)/e1 -L $(TMPDIR)/e2
|
|
|
|
$(RUSTC) f.rs -L crate=$(TMPDIR)/e1 -L $(TMPDIR)/e2
|
|
|
|
$(RUSTC) f.rs -L crate=$(TMPDIR)/e1 -L crate=$(TMPDIR)/e2
|
|
|
|
# Different hash, errors.
|
|
|
|
$(RUSTC) e2.rs -o $(TMPDIR)/e2/libe.rlib
|
2014-12-16 22:32:02 +00:00
|
|
|
$(RUSTC) f.rs -L $(TMPDIR)/e1 -L $(TMPDIR)/e2 && exit 1 || exit 0
|
2014-12-31 23:10:45 +00:00
|
|
|
$(RUSTC) f.rs -L crate=$(TMPDIR)/e1 -L $(TMPDIR)/e2 && exit 1 || exit 0
|
|
|
|
$(RUSTC) f.rs -L crate=$(TMPDIR)/e1 -L crate=$(TMPDIR)/e2 && exit 1 || exit 0
|
2016-04-05 02:07:08 +00:00
|
|
|
# Native/dependency paths don't cause errors.
|
2014-12-31 23:10:45 +00:00
|
|
|
$(RUSTC) f.rs -L native=$(TMPDIR)/e1 -L $(TMPDIR)/e2
|
|
|
|
$(RUSTC) f.rs -L dependency=$(TMPDIR)/e1 -L $(TMPDIR)/e2
|
|
|
|
$(RUSTC) f.rs -L dependency=$(TMPDIR)/e1 -L crate=$(TMPDIR)/e2
|