about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorShotaro Yamada <sinkuu@sinkuu.xyz>2018-04-10 23:40:34 +0900
committerShotaro Yamada <sinkuu@sinkuu.xyz>2018-04-11 01:17:59 +0900
commite986510bde5baeee952adaeac619dfcb2e62dfbc (patch)
treec2a2ef8a15aa34b67c28b07e02723f31dddcf000 /src
parentbbed61d3d2489eb974d52e327b4fe63e361426ce (diff)
downloadrust-e986510bde5baeee952adaeac619dfcb2e62dfbc.tar.gz
rust-e986510bde5baeee952adaeac619dfcb2e62dfbc.zip
Add test
Diffstat (limited to 'src')
-rw-r--r--src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile8
-rw-r--r--src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs18
-rw-r--r--src/test/run-make-fulldeps/save-analysis-rfc2126/extern_in_paths.rs17
-rw-r--r--src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs15
4 files changed, 58 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
new file mode 100644
index 00000000000..2f5ed6716d6
--- /dev/null
+++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
@@ -0,0 +1,8 @@
+-include ../tools.mk
+
+all: extern_absolute_paths.rs extern_in_paths.rs krate2
+	$(RUSTC) extern_absolute_paths.rs -Zsave-analysis
+	$(RUSTC) extern_in_paths.rs -Zsave-analysis
+
+krate2: krate2.rs
+	$(RUSTC) $<
diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs b/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs
new file mode 100644
index 00000000000..b1fe535766d
--- /dev/null
+++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_absolute_paths.rs
@@ -0,0 +1,18 @@
+// Copyright 2018 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.
+
+#![feature(extern_absolute_paths)]
+
+use krate2::hello;
+
+fn main() {
+    hello();
+    ::krate2::hello();
+}
diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_in_paths.rs b/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_in_paths.rs
new file mode 100644
index 00000000000..e48627e86ba
--- /dev/null
+++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/extern_in_paths.rs
@@ -0,0 +1,17 @@
+// Copyright 2018 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.
+
+#![feature(extern_in_paths)]
+
+use extern::krate2;
+
+fn main() {
+    extern::krate2::hello();
+}
diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs b/src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs
new file mode 100644
index 00000000000..21fc57ccdf2
--- /dev/null
+++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/krate2.rs
@@ -0,0 +1,15 @@
+// Copyright 2018 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.
+
+#![crate_name = "krate2"]
+#![crate_type = "lib"]
+
+pub fn hello() {
+}