summaryrefslogtreecommitdiffstats
path: root/src/test/run-make-fulldeps/issue-83045
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/run-make-fulldeps/issue-83045
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/run-make-fulldeps/issue-83045')
-rw-r--r--src/test/run-make-fulldeps/issue-83045/Makefile33
-rw-r--r--src/test/run-make-fulldeps/issue-83045/a.rs1
-rw-r--r--src/test/run-make-fulldeps/issue-83045/b.rs1
-rw-r--r--src/test/run-make-fulldeps/issue-83045/c.rs1
4 files changed, 36 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/issue-83045/Makefile b/src/test/run-make-fulldeps/issue-83045/Makefile
new file mode 100644
index 000000000..34853cb1d
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-83045/Makefile
@@ -0,0 +1,33 @@
+include ../../run-make-fulldeps/tools.mk
+
+# This test case creates a situation where the crate loader would run
+# into an ICE when confronted with an invalid setup where it cannot
+# find the dependency of a direct dependency.
+#
+# The test case makes sure that the compiler produces the expected
+# error message but does not ICE immediately after.
+#
+# See https://github.com/rust-lang/rust/issues/83045
+
+# This is a platform-independent issue, no need to waste time testing
+# everywhere.
+# only-x86_64
+# only-linux
+
+# NOTE: We use BARE_RUSTC below so that the compiler can't find liba.rlib
+# If we used RUSTC the additional '-L TMPDIR' option would allow rustc to
+# actually find the crate.
+#
+# We check that we get the expected error message
+# But that we do not get an ICE
+
+all:
+ $(RUSTC) --crate-name=a --crate-type=rlib a.rs --verbose
+ $(RUSTC) --crate-name=b --crate-type=rlib --extern a=$(TMPDIR)/liba.rlib b.rs --verbose
+ $(BARE_RUSTC) --out-dir $(TMPDIR) \
+ --extern b=$(TMPDIR)/libb.rlib \
+ --crate-type=rlib \
+ --edition=2018 \
+ c.rs 2>&1 | tee $(TMPDIR)/output.txt || exit 0
+ $(CGREP) E0463 < $(TMPDIR)/output.txt
+ $(CGREP) -v "internal compiler error" < $(TMPDIR)/output.txt
diff --git a/src/test/run-make-fulldeps/issue-83045/a.rs b/src/test/run-make-fulldeps/issue-83045/a.rs
new file mode 100644
index 000000000..66d9f758e
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-83045/a.rs
@@ -0,0 +1 @@
+// empty on purpose
diff --git a/src/test/run-make-fulldeps/issue-83045/b.rs b/src/test/run-make-fulldeps/issue-83045/b.rs
new file mode 100644
index 000000000..f4876cfa4
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-83045/b.rs
@@ -0,0 +1 @@
+extern crate a;
diff --git a/src/test/run-make-fulldeps/issue-83045/c.rs b/src/test/run-make-fulldeps/issue-83045/c.rs
new file mode 100644
index 000000000..e0c452549
--- /dev/null
+++ b/src/test/run-make-fulldeps/issue-83045/c.rs
@@ -0,0 +1 @@
+use b as _;