fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.2 KiB33 linesraw
1include ../tools.mk
2
3# This test case creates a situation where the crate loader would run
4# into an ICE when confronted with an invalid setup where it cannot
5# find the dependency of a direct dependency.
6#
7# The test case makes sure that the compiler produces the expected
8# error message but does not ICE immediately after.
9#
10# See https://github.com/rust-lang/rust/issues/83045
11
12# This is a platform-independent issue, no need to waste time testing
13# everywhere.
14# only-x86_64
15# only-linux
16
17# NOTE: We use BARE_RUSTC below so that the compiler can't find liba.rlib
18#       If we used RUSTC the additional '-L TMPDIR' option would allow rustc to
19#       actually find the crate.
20#
21#       We check that we get the expected error message
22#       But that we do not get an ICE
23
24all:
25	$(RUSTC) --crate-name=a --crate-type=rlib a.rs --verbose
26	$(RUSTC) --crate-name=b --crate-type=rlib --extern a=$(TMPDIR)/liba.rlib b.rs --verbose
27	$(BARE_RUSTC) --out-dir $(TMPDIR) \
28	              --extern b=$(TMPDIR)/libb.rlib \
29				  --crate-type=rlib \
30				  --edition=2018 \
31				  c.rs 2>&1 | tee $(TMPDIR)/output.txt || exit 0
32	$(CGREP) E0463 < $(TMPDIR)/output.txt
33	$(CGREP) -v "internal compiler error" < $(TMPDIR)/output.txt