about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-11-10 21:52:55 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-11-13 13:40:25 +1100
commitceff2ca1fc57d60fa3af2372d49a23055aa441bc (patch)
treeea5cb3850254e82d3943d90070c121a34d2b23a5 /src/test
parent830c82dd741b2d2a248515203a0f6a6662a0abe6 (diff)
downloadrust-ceff2ca1fc57d60fa3af2372d49a23055aa441bc.tar.gz
rust-ceff2ca1fc57d60fa3af2372d49a23055aa441bc.zip
Tweak and add test for detecting libraries with mismatching target triples.
Closes #10814.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make/mismatching-target-triples/Makefile11
-rwxr-xr-xsrc/test/run-make/mismatching-target-triples/bar.rs11
-rwxr-xr-xsrc/test/run-make/mismatching-target-triples/foo.rs11
3 files changed, 33 insertions, 0 deletions
diff --git a/src/test/run-make/mismatching-target-triples/Makefile b/src/test/run-make/mismatching-target-triples/Makefile
new file mode 100644
index 00000000000..e79abf82233
--- /dev/null
+++ b/src/test/run-make/mismatching-target-triples/Makefile
@@ -0,0 +1,11 @@
+-include ../tools.mk
+
+# Issue #10814
+#
+# these are no_std to avoid having to have the standard library or any
+# linkers/assemblers for the relevant platform
+
+all:
+	$(RUSTC) foo.rs --target=i686-unknown-linux-gnu
+	$(RUSTC) bar.rs --target=x86_64-unknown-linux-gnu 2>&1 \
+		| grep "couldn't find crate .foo. with expected target triple x86_64-unknown-linux-gnu"
diff --git a/src/test/run-make/mismatching-target-triples/bar.rs b/src/test/run-make/mismatching-target-triples/bar.rs
new file mode 100755
index 00000000000..ed15e5d880a
--- /dev/null
+++ b/src/test/run-make/mismatching-target-triples/bar.rs
@@ -0,0 +1,11 @@
+// Copyright 2014 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.
+#![no_std]
+extern crate foo;
diff --git a/src/test/run-make/mismatching-target-triples/foo.rs b/src/test/run-make/mismatching-target-triples/foo.rs
new file mode 100755
index 00000000000..8afa43710dd
--- /dev/null
+++ b/src/test/run-make/mismatching-target-triples/foo.rs
@@ -0,0 +1,11 @@
+// Copyright 2014 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.
+#![no_std]
+#![crate_type = "lib"]