Add "run-make" test for trace-macros flag

This commit is contained in:
Thomas Jespersen 2015-04-14 15:40:10 +02:00
parent d14109ec7e
commit bed2d33523
3 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,9 @@
# This test verifies that "-Z trace-macros" works as it should. The traditional
# "hello world" program provides a small example of this as not only println! is
# listed, but also print! (since println! expands to this)
-include ../tools.mk
all:
$(RUSTC) -o $(TMPDIR)/hello -Z trace-macros hello.rs &> $(TMPDIR)/hello.trace
diff -u $(TMPDIR)/hello.trace hello.trace

View file

@ -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, World!");
}

View file

@ -0,0 +1,2 @@
println! { "Hello, World!" }
print! { concat ! ( "Hello, World!" , "\n" ) }