mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
Add test for deduplicate native lib in linking
This commit is contained in:
parent
004614c4b3
commit
8e42fa55db
12
src/test/run-make-fulldeps/link-dedup/Makefile
Normal file
12
src/test/run-make-fulldeps/link-dedup/Makefile
Normal file
@ -0,0 +1,12 @@
|
||||
# ignore-msvc
|
||||
|
||||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
$(RUSTC) depa.rs
|
||||
$(RUSTC) depb.rs
|
||||
$(RUSTC) depc.rs
|
||||
$(RUSTC) empty.rs --cfg bar 2>&1 | $(CGREP) '"-ltesta" "-ltestb" "-ltesta"'
|
||||
$(RUSTC) empty.rs 2>&1 | $(CGREP) '"-ltesta"'
|
||||
$(RUSTC) empty.rs 2>&1 | $(CGREP) -v '"-ltestb"'
|
||||
$(RUSTC) empty.rs 2>&1 | $(CGREP) -v '"-ltesta" "-ltesta"'
|
7
src/test/run-make-fulldeps/link-dedup/depa.rs
Normal file
7
src/test/run-make-fulldeps/link-dedup/depa.rs
Normal file
@ -0,0 +1,7 @@
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[link(name = "testa")]
|
||||
extern "C" {}
|
||||
|
||||
#[link(name = "testa")]
|
||||
extern "C" {}
|
8
src/test/run-make-fulldeps/link-dedup/depb.rs
Normal file
8
src/test/run-make-fulldeps/link-dedup/depb.rs
Normal file
@ -0,0 +1,8 @@
|
||||
#![feature(link_cfg)]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[link(name = "testb", cfg(foo))]
|
||||
extern "C" {}
|
||||
|
||||
#[link(name = "testb", cfg(bar))]
|
||||
extern "C" {}
|
4
src/test/run-make-fulldeps/link-dedup/depc.rs
Normal file
4
src/test/run-make-fulldeps/link-dedup/depc.rs
Normal file
@ -0,0 +1,4 @@
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[link(name = "testa")]
|
||||
extern "C" {}
|
5
src/test/run-make-fulldeps/link-dedup/empty.rs
Normal file
5
src/test/run-make-fulldeps/link-dedup/empty.rs
Normal file
@ -0,0 +1,5 @@
|
||||
extern crate depa;
|
||||
extern crate depb;
|
||||
extern crate depc;
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user