From 61f31fd559ba5925022a103a46e90db66eaa37be Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sun, 19 Nov 2017 17:55:10 -0500 Subject: [PATCH] add a simple test that running with hir-tree doesn't go bonkers Akin to the existing expanded test. --- src/test/run-make/hir-tree/Makefile | 9 +++++++++ src/test/run-make/hir-tree/input.rs | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/test/run-make/hir-tree/Makefile create mode 100644 src/test/run-make/hir-tree/input.rs 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + println!("Hello, Rustaceans!"); +}