2018-08-03 10:09:50 -05:00
|
|
|
|
|
|
|
-include ../tools.mk
|
|
|
|
|
|
|
|
# This test makes sure that we don't loose upstream object files when compiling
|
|
|
|
# staticlibs with -Zcross-lang-lto
|
|
|
|
|
|
|
|
all: staticlib.rs upstream.rs
|
|
|
|
$(RUSTC) upstream.rs -Z cross-lang-lto -Ccodegen-units=1
|
|
|
|
|
|
|
|
# Check No LTO
|
|
|
|
$(RUSTC) staticlib.rs -Z cross-lang-lto -Ccodegen-units=1 -L. -o $(TMPDIR)/staticlib.a
|
2019-01-21 18:47:57 -06:00
|
|
|
(cd $(TMPDIR); $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-ar x ./staticlib.a)
|
2018-08-03 10:09:50 -05:00
|
|
|
# Make sure the upstream object file was included
|
2018-08-06 04:16:28 -05:00
|
|
|
ls $(TMPDIR)/upstream.*.rcgu.o
|
2018-08-03 10:09:50 -05:00
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
rm $(TMPDIR)/*
|
|
|
|
|
|
|
|
# Check ThinLTO
|
|
|
|
$(RUSTC) upstream.rs -Z cross-lang-lto -Ccodegen-units=1 -Clto=thin
|
|
|
|
$(RUSTC) staticlib.rs -Z cross-lang-lto -Ccodegen-units=1 -Clto=thin -L. -o $(TMPDIR)/staticlib.a
|
2019-01-21 18:47:57 -06:00
|
|
|
(cd $(TMPDIR); $(LD_LIB_PATH_ENVVAR)=$(REAL_LD_LIBRARY_PATH) llvm-ar x ./staticlib.a)
|
2018-08-06 04:16:28 -05:00
|
|
|
ls $(TMPDIR)/upstream.*.rcgu.o
|