diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2019-04-05 11:32:45 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2019-04-05 11:32:45 +0200 |
| commit | a6e802ab4c84fb50b484fb12bbf397b889c70f77 (patch) | |
| tree | ce1953865dba489fdc4b88b0feed0f548a0244ca | |
| parent | ef648f4a4936700c7ebf85f82cbcba29a6187bcc (diff) | |
| download | rust-a6e802ab4c84fb50b484fb12bbf397b889c70f77.tar.gz rust-a6e802ab4c84fb50b484fb12bbf397b889c70f77.zip | |
Add regression test for #59137.
| -rw-r--r-- | src/test/run-make-fulldeps/lto-dylib-dep/Makefile | 10 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/lto-dylib-dep/a_dylib.rs | 4 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/lto-dylib-dep/main.rs | 6 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/lto-dylib-dep/Makefile b/src/test/run-make-fulldeps/lto-dylib-dep/Makefile new file mode 100644 index 00000000000..ab8ee6c2ef7 --- /dev/null +++ b/src/test/run-make-fulldeps/lto-dylib-dep/Makefile @@ -0,0 +1,10 @@ +-include ../tools.mk + +# Test that we don't run into an assertion when using a Rust dylib dependency +# while compiling with full LTO. +# See https://github.com/rust-lang/rust/issues/59137 + +all: + $(RUSTC) a_dylib.rs --crate-type=dylib -C prefer-dynamic + $(RUSTC) main.rs -C lto + $(call RUN,main) diff --git a/src/test/run-make-fulldeps/lto-dylib-dep/a_dylib.rs b/src/test/run-make-fulldeps/lto-dylib-dep/a_dylib.rs new file mode 100644 index 00000000000..c5a35296f89 --- /dev/null +++ b/src/test/run-make-fulldeps/lto-dylib-dep/a_dylib.rs @@ -0,0 +1,4 @@ + +pub fn foo() { + println!("bar"); +} diff --git a/src/test/run-make-fulldeps/lto-dylib-dep/main.rs b/src/test/run-make-fulldeps/lto-dylib-dep/main.rs new file mode 100644 index 00000000000..af0955e7f35 --- /dev/null +++ b/src/test/run-make-fulldeps/lto-dylib-dep/main.rs @@ -0,0 +1,6 @@ + +extern crate a_dylib; + +fn main() { + a_dylib::foo(); +} |
