about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Chugunov <vadimcn@gmail.com>2016-04-08 17:14:05 -0700
committerVadim Chugunov <vadimcn@gmail.com>2016-04-08 17:14:05 -0700
commitcc3b6f24b7604880279918b3c1a58ef62fb06b36 (patch)
treed068ab789e3f660f30d9b683cb97e7b99be55b64
parent7edc16c7be4dab322305487d31e18c2b79ed26c5 (diff)
downloadrust-cc3b6f24b7604880279918b3c1a58ef62fb06b36.tar.gz
rust-cc3b6f24b7604880279918b3c1a58ef62fb06b36.zip
Added a test
-rw-r--r--src/test/run-make/symlinked-rlib/Makefile14
-rw-r--r--src/test/run-make/symlinked-rlib/bar.rs15
-rw-r--r--src/test/run-make/symlinked-rlib/foo.rs11
3 files changed, 40 insertions, 0 deletions
diff --git a/src/test/run-make/symlinked-rlib/Makefile b/src/test/run-make/symlinked-rlib/Makefile
new file mode 100644
index 00000000000..2709f786e0a
--- /dev/null
+++ b/src/test/run-make/symlinked-rlib/Makefile
@@ -0,0 +1,14 @@
+-include ../tools.mk
+
+# ignore windows: `ln` is actually `cp` on msys.
+ifndef IS_WINDOWS
+
+all:
+	$(RUSTC) foo.rs --crate-type=rlib -o $(TMPDIR)/foo.xxx
+	ln -nsf $(TMPDIR)/foo.xxx $(TMPDIR)/libfoo.rlib
+	$(RUSTC) bar.rs -L $(TMPDIR)
+
+else
+all:
+
+endif
diff --git a/src/test/run-make/symlinked-rlib/bar.rs b/src/test/run-make/symlinked-rlib/bar.rs
new file mode 100644
index 00000000000..e8f06680862
--- /dev/null
+++ b/src/test/run-make/symlinked-rlib/bar.rs
@@ -0,0 +1,15 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern crate foo;
+
+fn main() {
+    foo::bar();
+}
diff --git a/src/test/run-make/symlinked-rlib/foo.rs b/src/test/run-make/symlinked-rlib/foo.rs
new file mode 100644
index 00000000000..5abbb1dcbce
--- /dev/null
+++ b/src/test/run-make/symlinked-rlib/foo.rs
@@ -0,0 +1,11 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub fn bar() {}