Skip to content

Commit 19041cd

Browse files
committed
Add a regression test for #29122 (fixed in #29134)
1 parent 140e793 commit 19041cd

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-include ../tools.mk
2+
3+
# Make sure we don't ICE if the linker prints a non-UTF-8 error message.
4+
5+
# The zzz it to allow humans to tab complete or glob this thing.
6+
bad_dir := $(TMPDIR)/zzz$$'\xff'
7+
8+
all:
9+
$(RUSTC) library.rs
10+
mkdir $(bad_dir)
11+
mv $(call DYLIB,library) $(bad_dir)
12+
LIBRARY_PATH=$(bad_dir) $(RUSTC) exec.rs 2>&1 | grep this_symbol_not_defined
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[link(name="library")]
2+
extern "C" {
3+
fn foo();
4+
}
5+
6+
fn main() { unsafe { foo(); } }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![crate_type = "dylib"]
2+
3+
extern "C" {
4+
fn this_symbol_not_defined();
5+
}
6+
7+
pub extern "C" fn foo() {
8+
unsafe { this_symbol_not_defined(); }
9+
}

0 commit comments

Comments
 (0)