about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/dylib-soname/rmake.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/run-make/dylib-soname/rmake.rs b/tests/run-make/dylib-soname/rmake.rs
index cec0d463842..714997cbc1a 100644
--- a/tests/run-make/dylib-soname/rmake.rs
+++ b/tests/run-make/dylib-soname/rmake.rs
@@ -7,12 +7,16 @@
 use run_make_support::{cmd, run_in_tmpdir, rustc};
 
 fn main() {
+    let check = |ty: &str| {
+        rustc().crate_name("foo").crate_type(ty).input("foo.rs").run();
+        cmd("readelf").arg("-d").arg("libfoo.so").run()
+    };
     run_in_tmpdir(|| {
-        rustc().crate_name("foo").crate_type("dylib").input("foo.rs").run();
-        cmd("readelf")
-            .arg("-d")
-            .arg("libfoo.so")
-            .run()
-            .assert_stdout_contains("Library soname: [libfoo.so]");
+        // Rust dylibs should get a relative SONAME
+        check("dylib").assert_stdout_contains("Library soname: [libfoo.so]");
+    });
+    run_in_tmpdir(|| {
+        // C dylibs should not implicitly get any SONAME
+        check("cdylib").assert_stdout_not_contains("Library soname:");
     });
 }