]> git.lizzy.rs Git - rust.git/blob - tests/run-make/issue-85401-static-mir/Makefile
Rollup merge of #107687 - cjgillot:sroa-2, r=oli-obk
[rust.git] / tests / run-make / issue-85401-static-mir / Makefile
1 include ../../run-make-fulldeps/tools.mk
2
3 # Regression test for issue #85401
4 # Verify that we do not ICE when trying to access MIR for statics,
5 # but emit an error when linking.
6
7 OUTPUT_FILE := $(TMPDIR)/build-output
8
9 all:
10         $(RUSTC) --crate-type rlib --crate-name foo -Crelocation-model=pic --edition=2018 foo.rs -Zalways-encode-mir=yes --emit metadata -o $(TMPDIR)/libfoo.rmeta
11         $(RUSTC) --crate-type rlib --crate-name bar -Crelocation-model=pic --edition=2018 bar.rs -o $(TMPDIR)/libbar.rlib --extern=foo=$(TMPDIR)/libfoo.rmeta
12         $(RUSTC) --crate-type bin --crate-name baz -Crelocation-model=pic --edition=2018 baz.rs -o $(TMPDIR)/baz -L $(TMPDIR) --extern=bar=$(TMPDIR)/libbar.rlib > $(OUTPUT_FILE) 2>&1; [ $$? -eq 1 ]
13         cat  $(OUTPUT_FILE)
14         $(CGREP) 'crate `foo` required to be available in rlib format, but was not found in this form' < $(OUTPUT_FILE)
15         # -v tests are fragile, hopefully this text won't change
16         $(CGREP) -v "internal compiler error" < $(OUTPUT_FILE)