about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-11-19 17:55:10 -0500
committerNiko Matsakis <niko@alum.mit.edu>2017-11-20 05:58:11 -0500
commit61f31fd559ba5925022a103a46e90db66eaa37be (patch)
tree6bc8a626c66354680b45da32cc668d291460d972
parent1058c89c695fdda9f059ca9db3a01bb5248257cd (diff)
downloadrust-61f31fd559ba5925022a103a46e90db66eaa37be.tar.gz
rust-61f31fd559ba5925022a103a46e90db66eaa37be.zip
add a simple test that running with hir-tree doesn't go bonkers
Akin to the existing expanded test.
-rw-r--r--src/test/run-make/hir-tree/Makefile9
-rw-r--r--src/test/run-make/hir-tree/input.rs13
2 files changed, 22 insertions, 0 deletions
diff --git a/src/test/run-make/hir-tree/Makefile b/src/test/run-make/hir-tree/Makefile
new file mode 100644
index 00000000000..59e4ae8a30d
--- /dev/null
+++ b/src/test/run-make/hir-tree/Makefile
@@ -0,0 +1,9 @@
+-include ../tools.mk
+
+# Test that hir-tree output doens't crash and includes
+# the string constant we would expect to see.
+
+all:
+	$(RUSTC) -o $(TMPDIR)/input.hir -Z unstable-options \
+		--unpretty=hir-tree input.rs
+	grep '"Hello, Rustaceans!\\n"' $(TMPDIR)/input.hir
diff --git a/src/test/run-make/hir-tree/input.rs b/src/test/run-make/hir-tree/input.rs
new file mode 100644
index 00000000000..12adc083bcd
--- /dev/null
+++ b/src/test/run-make/hir-tree/input.rs
@@ -0,0 +1,13 @@
+// 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.
+
+fn main() {
+    println!("Hello, Rustaceans!");
+}