summaryrefslogtreecommitdiffstats
path: root/tests/run-make/print-native-static-libs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/run-make/print-native-static-libs/Makefile6
-rw-r--r--tests/run-make/print-native-static-libs/bar.rs6
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/run-make/print-native-static-libs/Makefile b/tests/run-make/print-native-static-libs/Makefile
index 98e72d769..a16c8b0f2 100644
--- a/tests/run-make/print-native-static-libs/Makefile
+++ b/tests/run-make/print-native-static-libs/Makefile
@@ -5,7 +5,7 @@ include ../tools.mk
all:
$(RUSTC) --crate-type rlib -lbar_cli bar.rs
- $(RUSTC) foo.rs -lfoo_cli --crate-type staticlib --print native-static-libs 2>&1 \
+ $(RUSTC) foo.rs -lfoo_cli -lfoo_cli --crate-type staticlib --print native-static-libs 2>&1 \
| grep 'note: native-static-libs: ' \
| sed 's/note: native-static-libs: \(.*\)/\1/' > $(TMPDIR)/libs.txt
@@ -13,3 +13,7 @@ all:
cat $(TMPDIR)/libs.txt | grep -F "systemd" # in foo.rs
cat $(TMPDIR)/libs.txt | grep -F "bar_cli"
cat $(TMPDIR)/libs.txt | grep -F "foo_cli"
+
+ # make sure that foo_cli and glib-2.0 are not consecutively present
+ cat $(TMPDIR)/libs.txt | grep -Fv "foo_cli -lfoo_cli"
+ cat $(TMPDIR)/libs.txt | grep -Fv "glib-2.0 -lglib-2.0"
diff --git a/tests/run-make/print-native-static-libs/bar.rs b/tests/run-make/print-native-static-libs/bar.rs
index a563bbc2a..cd9c1c453 100644
--- a/tests/run-make/print-native-static-libs/bar.rs
+++ b/tests/run-make/print-native-static-libs/bar.rs
@@ -3,6 +3,7 @@ pub extern "C" fn my_bar_add(left: i32, right: i32) -> i32 {
// Obviously makes no sense but...
unsafe {
g_free(std::ptr::null_mut());
+ g_free2(std::ptr::null_mut());
}
left + right
}
@@ -11,3 +12,8 @@ pub extern "C" fn my_bar_add(left: i32, right: i32) -> i32 {
extern "C" {
fn g_free(p: *mut ());
}
+
+#[link(name = "glib-2.0")]
+extern "C" {
+ fn g_free2(p: *mut ());
+}